Displaying data between the rows in datagrid

smriti

Regular
Joined
Jan 7, 2005
Messages
54
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.
 
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.
 
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 DB
 

Attachments

Back
Top