Articles in this section

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 If

The screenshot below illustrates the value for the selected record in the child table.

Show the value from the selected record




















Figure 1: Value from the selected record


Samples:

C#: Selected record-C#

VB: Selected record-VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied