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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

67059 Aug 8,2007 02:39 AM Aug 8,2007 03:06 AM Windows Forms 1
loading
Tags: GridControl
Abhijeet Kumar
Asked On August 8, 2007 02:39 AM

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

Administrator [Syncfusion]
Replied On August 8, 2007 03:06 AM

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"));
}
}
}


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;