I''ve got a GridGroupingControl bound to a hierarchical dataset.
There are 3 group levels. I''ll call them levels 1, 2, and 3, where level 1 is the top level, and level 3 is the bottom level.
When a user double-clicks a row in the last group (level 3), how do I obtain the current value from the corresponding parent group (level 2)?
P.S. Is there a KB article or other documentation that provides an overview of the object hierarchy in a grid grouping control? I keep getting confused when trying to traverse it. Just when I think I know what TableControl.Table.CurrentElement.ParentElement is supposed to return, I find out I''m wrong again!
ADAdministrator Syncfusion Team June 4, 2005 05:56 AM
To get the record from the parent node of the double click cell, try:
private void gridGroupingControl1_TableControlCurrentCellControlDoubleClick(object sender, GridTableControlControlEventArgs e)
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = e.TableControl.Model[cc.RowIndex, cc.ColIndex];
GridRecord rec = style.TableCellIdentity.DisplayElement.ParentTable.CurrentRecord as GridRecord;
if(rec != null)
object o = rec.GetData();//retrieves the object in the row
//if you are using DataTables, you can cast it to a DataView
Console.WriteLine(((DataRowView)o)); // 2nd col in dataview