Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted
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.

Afraits

"The avalanche has started, it is too late for the pebbles to vote"

Posted

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

CSharpADONavigation.zip

Afraits

"The avalanche has started, it is too late for the pebbles to vote"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...