Getting parent of selected record

I have a nested GridGroupingControl and I am trapping the SelectedRecordsChanged event. I need to know the parent or the parent's parent when a record is selected in the fourth or fifth table/record in the nesting. I am using e->SelectedRecord->Record->Parent but it is Null even though I am not at the top level. How do I get the selected records parent record?

Thanks

WJL

1 Reply

AD Administrator Syncfusion Team December 22, 2006 04:13 AM UTC

Hi Bill,

Try the following code snippet to get the ParentRecord in SelectedRecordsChanged event.

private void gridGroupingControl1_SelectedRecordsChanged(object sender, SelectedRecordsChangedEventArgs e)
{
if( e.SelectedRecord != null )
{
ChildTable ctable = e.SelectedRecord.Record.ParentChildTable;
NestedTable ntable = ctable.ParentNestedTable;
if( ntable != null )
Console.WriteLine("ParentRecord is ===> " + ntable.ParentRecord);
}
}

Here is a sample.
GGC_ParentRecord.zip

Best Regards,
Haneef

Loader.
Up arrow icon