Home › Forums › WPF controls › Xceed DataGrid for WPF › Master / Detail how to get Master data when focused on detai
Normally if you want to get data from a row that you are focused on you can use something like this line:
String site_name = (string)(((System.Data.DataRow)DataGridControl_Site_ID.SelectedItem).ItemArray);
I know this line will let you get the Detail value:
create_task_window.site_name = (string)(((System.Data.DataRow)dataGridControl_Site_ID.GlobalCurrentItem).ItemArray);
But if you are focused on a Detail row on the DataGrid how do you get the Master datarow?
Imported from legacy forums. Posted by David (had 2477 views)
You can check the ParentItem property of the detail’s DataGridContext.
Imported from legacy forums. Posted by Jenny [Xceed] (had 231 views)
Thanks Jenny! Got it working now.
Imported from legacy forums. Posted by David (had 3594 views)