We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

TableControlCellDoubleClick Event - value from parent group?

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)? Thanks, s.s. 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!

1 Reply

AD Administrator Syncfusion Team June 4, 2005 10:56 AM UTC

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)[1]); // 2nd col in dataview

Live Chat Icon For mobile
Up arrow icon