GGC row select & click event

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

2 Replies

AD Administrator Syncfusion Team 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


AD Administrator Syncfusion Team 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

Loader.
Up arrow icon