smriti Posted April 12, 2005 Posted April 12, 2005 Hi all, I am having a datagrid in my windows form application. when i select one of the row in the datagrid then another datagrid is to be displayed below that row. That is a datagrid is to be displayed with in a datagrid(between the rows of the first datagrid) Is it possible to display data between rows of a datagrid? If so please guide me with u r suggestions or any samples. Thanks. Quote
Afraits Posted April 12, 2005 Posted April 12, 2005 Have a look at the heirarchical properties of datagrids, they are bound to datasets containing multiple tables bound with relationships, eg Customers ->orders _> order details, clicking on a row will display the child rows of that parent, v easy to do with v little code - I believe examples are on MSDN - if I have time I'll try to dig one out for you today. Quote Afraits "The avalanche has started, it is too late for the pebbles to vote"
Afraits Posted April 12, 2005 Posted April 12, 2005 Example Setup 3 dataadapters to northwind DB for Customers, Orders & [Order details] tables, create typed dataset and define relationships between the three tables Add datagrid to form and set datasource to the typed dataset and datamember to the customers table, use the three adapters to fill the dataset in the form load and run - your results should look like the attachment, was that what you were trying to achieve? Example is in C# but as virtually everything is using .NET components it should be understandable Note: the connection will need to be adjusted to your implementation of northwind DBCSharpADONavigation.zip Quote Afraits "The avalanche has started, it is too late for the pebbles to vote"
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.