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