How to get the value from a selected record in the child table in WinForms GridGroupingControl?
Select the record
The
table-related events get triggered only based on the actions performed in the
respective tables. Hooking the Table.SelectedRecordsChanged event
affects the parent table alone, by default. So, selecting any record in the
child table does not trigger this event, but the Table.SelectedRecordsChanged event
of the respective child table has to be hooked to achieve the same. The
following code example is used to get a selected record value from
a child table in the WinForms GridGroupingControl.
C#
//Gets the child table SelectedRecordsChanged event.
this.gridGroupingControl1.GetTable("Child").SelectedRecordsChanged += new Syncfusion.Grouping.SelectedRecordsChangedEventHandler(Form1_SelectedRecordsChanged);
void Form1_SelectedRecordsChanged(object sender, Syncfusion.Grouping.SelectedRecordsChangedEventArgs e)
{
if(e.Action == Syncfusion.Grouping.SelectedRecordsChangedType.Added)
{
//selected record of the child table will be added into list.
listBox1.Items.Add(e.SelectedRecord.Record.Info);
}
}VB
'Gets the child table SelectedRecordsChanged event.
AddHandler gridGroupingControl1.GetTable("Child").SelectedRecordsChanged, AddressOf Form1_SelectedRecordsChanged
void Form1_SelectedRecordsChanged(Object sender, Syncfusion.Grouping.SelectedRecordsChangedEventArgs e)
If e.Action = Syncfusion.Grouping.SelectedRecordsChangedType.Added Then
listBox1.Items.Add(e.SelectedRecord.Record.Info)
End IfThe
screenshot below illustrates the value for the selected record in the child
table.

Figure 1:
Value from the selected record
Samples: