Click here to Skip to main content
15,921,905 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to display multiple data of 2 table, but there is primary key in table1 & foreign key in table2. So table2 contains multiple data for same primary key. Thus i have to display in grid.

What I have tried:

I have no idea how to deal with this.
Posted
Updated 11-Apr-18 1:49am
Comments
[no name] 11-Apr-18 7:16am    
You did not mention in which application you need to implement the nested grid. Is that ASP.NET / Forms ?
Member 11776570 11-Apr-18 7:46am    
In windows form.

1 solution

Here is an example of a nested datagridview: Nested DataGridView in windows forms c#[^]

And here is another one that uses an SQL Server database: Master Detail Datagridview in C#[^]
 
Share this answer
 
v2
Comments
Member 11776570 11-Apr-18 8:41am    
But you have added data manually. I have to add data from database.
Maciej Los 11-Apr-18 11:40am    
What's the difference?
Maciej Los 11-Apr-18 11:40am    
5ed!
BillWoodruff 11-Apr-18 14:33pm    
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900