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
close icon

Get row in which user double clicks in GGC v 4.1.0.58 .

Hi,
I am using GroupingGrid control in my windows application. I am using TableControlCurrentCellControlDoubleClick event to capture double click in any row of the grid. Now How can i get the data in the row on which the user clicks. Suppose i want to popup a dialog with the data in that row how can i get that.
Secondly, how can i determine if the clicked row is a parent or a child. I want to show the popup only if user clicks on the child row. and not when user clicked on any parent row.

I am using following code to populate the datagrid.

parentTable = GetParentTable();
childTable = GetChildTable();



GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor();
parentToChildRelationDescriptor.ChildTableName = "MyChildTable"; // same as SourceListSetEntry.Name for childTable (see below)
parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;
parentToChildRelationDescriptor.RelationKeys.Add("Basket Name", "Basket Name");

// Add relation to ParentTable
gridGroupingControl1.TableDescriptor.Relations.Add(parentToChildRelationDescriptor);

this.gridGroupingControl1.Engine.SourceListSet.Add("MyParentTable", parentTable);
this.gridGroupingControl1.Engine.SourceListSet.Add("MyChildTable", childTable);

this.gridGroupingControl1.DataSource = parentTable;

Thanks

1 Reply

AD Administrator Syncfusion Team August 8, 2007 07:06 AM UTC

Here is one way you can get at the record that was doubles clicked.

void gridGroupingControl1_TableControlCurrentCellControlDoubleClick(object sender, GridTableControlControlEventArgs e)
{
GridRecord rec = e.TableControl.Table.CurrentRecord as GridRecord;
if (rec != null && rec.ParentChildTable.Name == "ChildTable")
{
if (rec != null)
{
Console.WriteLine(rec.GetValue("ScienceScore"));
}
}
}


Loader.
Live Chat Icon For mobile
Up arrow icon