Hi Rasika,
Thank you for your interest in Syncfusion products.
We have analyzed your reported scenario. In order to get the record from a GridGroupingcontrol, you can use GridTableCellStyleInfo. Before fetching the record details using GetRecord, a validation is need to ensure the clicked cell is a record and the display element is not equal to null(this would resolve your problem of null reference exception).Please refer the below provided KB ,code snippet and sample for further clarification.
Code Snippet[c#]:
void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
GridTableCellStyleInfoIdentity id = style.TableCellIdentity;
if (id.DisplayElement!=null && id.DisplayElement.Kind == DisplayElementKind.Record)//this is to validate whether the cell click is done only in value cells and not in headers/Caption row/anyother.
{
Record rec = id.DisplayElement.GetRecord();
MessageBox.Show("RowIndex is:" + rec.Id.ToString()); //Real RowIndex
}
}
Sample:
http://www.syncfusion.com/downloads/support/forum/118944/WindowsFormsApplication21_(2)755905147.zip
KB Link:
http://www.syncfusion.com/kb/4275/how-can-i-identify-a-record-from-the-gridstyleinfo
Note: If still your issue is not resolved. Please provide us a step by step replication procedure or replicate in the above provided sample and send back to us. So, that it would be easy for us to provide a prompt solution as early as possible.
Please let us know if you have any other concerns.
Thanks & Regards,
AL.Solai.