The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator 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
ADAdministrator 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