GridGgroupingControl and GridDataBoundGrid - get DataBound Object from Row
Thank you for using Syncfusion products.
|
To get record values in double click event of Grid Grouping Control |
Please find the below code example and sample to get the doublecliked cell’s record. Code Example : this.gridGroupingControl1.TableControlCellDoubleClick += new GridTableControlCellClickEventHandler(gridGroupingControl1_TableControlCellDoubleClick); void gridGroupingControl1_TableControlCellDoubleClick(object sender, GridTableControlCellClickEventArgs e) { Record rec = this.gridGroupingControl1.Table.CurrentRecord; string column1value = rec.GetValue("Id").ToString(); string column2value = rec.GetValue("A").ToString(); string column3value = rec.GetValue("B").ToString(); string column4value = rec.GetValue("Date").ToString(); string column5value = rec.GetValue("Value").ToString();
} Sample : http://www.syncfusion.com/downloads/support/forum/121399/ze/WindowsFormsApplication_recordvalue984172926
Note : We have used cell doubleclick event, you can use any other double click event to as per your need with the same code. |
|
To get record values in double click event of grid data bound grid |
Please find the below code example and sample to get the doublecliked cell’s record. Code Example : this.gridDataBoundGrid1.CellDoubleClick += new GridCellClickEventHandler(gridDataBoundGrid1_CellDoubleClick); this.gridDataBoundGrid1.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(gridDataBoundGrid1_PrepareViewStyleInfo); void gridDataBoundGrid1_CellDoubleClick(object sender, GridCellClickEventArgs e) { isdoubleclick = !isdoubleclick; } void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) {
if (isdoubleclick && e.RowIndex > 0 && e.ColIndex > 0) { CurrencyManager cm = (CurrencyManager)BindingContext[gridDataBoundGrid1.DataSource, gridDataBoundGrid1.DataMember];
DataRow row;
DataView dv = (DataView)cm.List; //The 2 is the rowindex.
int position = this.gridDataBoundGrid1.Binder.RowIndexToPosition(e.RowIndex);
row = dv[position].Row; object[] SelectedRow = row.ItemArray; } }
Sample : http://www.syncfusion.com/downloads/support/forum/121399/ze/GDBG_recordvalue-746634142
Note : We have used cell DoubleClick event, you can use any other double click event to as per your need with the same code.
|
Thanks,
AL.Solai.
Thank you for your update.
We are glad to know that your issue has been resolved. Please let us know if you have any concerns in future.
Thanks,
AL.Solai.
ClassObj myObj = this.gridGroupingControl1.Table.CurrentRecord.GetData() as ClassObj;
- 6 Replies
- 4 Participants
-
SY SysNop
- Dec 10, 2015 06:52 AM UTC
- Jan 16, 2018 08:34 AM UTC