Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
I have a DatagridView bound to a SQL server table - which has a oneto many relationship.
I have a second datagridview bound to the linq to sql dataset property of the list of secondary records. When the Selected Item changes in the first Grid attached controls - text boxes, check boxes etc. update, but I cannot get the second grid to update to the new list of records.

Any help would be useful.

I have tried the reset methods on the datasource, firing property changed events etc. to no avail.

Many thanks


example:

Data:
group1

links to:

site1
site2


group2

links to:

site3
site4



Grid 1 selected
group1

Grid 2 shows
site1
site2

changing Grid 1 selection
group2

Grid 2 still shows
site1
site2

instead of the second grid changing to site3, site4 when the selection of the first grid changes.
Posted
Updated 19-Oct-14 23:52pm
v4
Comments
SRS(The Coder) 20-Oct-14 7:50am    
Can you please share some code what you achieved till now ?
Ziee-M 20-Oct-14 11:09am    
Hi, load the new data in a list when you click in the first datagrid, then bind the list to the second dataGrid.
//Click event
MyList = GetSelectedObjectInformation(); //this method returns the data of the selected object

DataGridView2 = MyList; be sure to bind in case your GridView is not binded to the the type of your list.

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