Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one scenario in which i have two forms one contain DataGrid for Master and on double click that will open child form which allow me to make any changes, the issue is when i update the child information i have to update same related information on my Master DataGrid.

For your information, I am using C#.

I have try following to reflect the changes.

DataTable _MyTable;

_MyTable.PrimaryKey = new DataColumn[] { _MyTable.Columns["Id"] };
((DataView)dgListing.ItemsSource).ToTable().Merge(_MyTable);
((DataView)dgListing.ItemsSource).ToTable().AcceptChanges();

dgListing.Items.Refresh();


but above code not help me anyway.

_MyTable fetch the updated record from Database.
dgListing is My DataGrid
I have fill my DataGrid as follows at the time of Master Form Load

dt.PrimaryKey = new DataColumn[] { dt.Columns["Id"] };
dgListing.ItemsSource = dt.DefaultView;


Thanks and Regards,
Posted
Updated 23-Jul-14 23:45pm
v2

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