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.
Syncfusion Feedback

GGC row select & click event

Thread ID:

Created:

Updated:

Platform:

Replies:

45454 Jun 21,2006 02:09 PM UTC Jun 22,2006 08:33 PM UTC Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 21, 2006 02:09 PM UTC

I have a GGC with the datasource bound to a datatable. When the user doubleclicks on a row I want to catch that event and open another form based on the data in that row. How can I do this? Thanks, Rich

Administrator [Syncfusion]
Replied On June 21, 2006 04:26 PM UTC

Hi Rich, To get the record from the parent node of the double click cell, you need to handle the TableControlCurrentCellControlDoubleClick event. Here is a code snippet. 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 //Form the Open Here } } Please let me know if this helps. Best Regards, Haneef

Administrator [Syncfusion]
Replied On June 22, 2006 08:33 PM UTC

Hi Haneef, So I need to reference Syncfusion.Web.UI.WebControls.Grid.Grouping to use this, right? >Hi Rich, > >To get the record from the parent node of the double click cell, you need to handle the TableControlCurrentCellControlDoubleClick event. Here is a code snippet. > >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 > //Form the Open Here > } >} > >Please let me know if this helps. >Best Regards, >Haneef

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.

Warning Icon 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.Close Icon

;