BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi Josip,
Thanks for your interest in Syncfusion products.
The recommended way to get the current record value onTableControlCellDoubleClickevent is by getting the style of the current cell usingGetTableViewStyleInfo()methodby passing theRowIndexandColumnIndexof the clicked cell. Please make use of the below code and sample,
Code Snippet
//Event Triggering this.gridGroupingControl1.TableControlCellDoubleClick += GridGroupingControl1_TableControlCellDoubleClick; //Event Customization privatevoidGridGroupingControl1_TableControlCellDoubleClick(objectsender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventArgse) { //To pass the column index and row index of current record intcolumnIndex = e.Inner.ColIndex; introwIndex = e.Inner.RowIndex; Console.WriteLine(GetRecordValue(rowIndex, columnIndex)); } //To Get the cell value of current record privatestringGetRecordValue(introwIndex,intcolumnIndex) { stringcellValue =string.Empty; //To get the style of current cell GridTableCellStyleInfostyle =this.gridGroupingControl1.TableControl.GetTableViewStyleInfo(rowIndex, columnIndex); if(style.TableCellIdentity !=null&& (style.TableCellIdentity.TableCellType ==GridTableCellType.RecordFieldCell || style.TableCellIdentity.TableCellType ==GridTableCellType.AlternateRecordFieldCell)) { Recordrecord = style.TableCellIdentity.DisplayElement.GetRecord(); //To get the cell value of current cell cellValue = record.GetValue(style.TableCellIdentity.Column.Name).ToString(); } returncellValue; } |
Screenshot
Sample Link
http://www.syncfusion.com/downloads/support/forum/129237/ze/CellValue_on_DoubleClick-1221361787
Regards,
Arulpriya
Hi Josip,
Thanks for your update.
The hidden column’s record cell value can also be retrieved by passing the hidden column name in the Record.GetValue(“HiddenColumnName”) method. In the below sample, Date column is in hidden mode and value can be retrieved by double clicking on a record.
Code Snippet
//Event Triggering this.gridGroupingControl1.TableControlCellDoubleClick += GridGroupingControl1_TableControlCellDoubleClick; //Event Customization private void GridGroupingControl1_TableControlCellDoubleClick(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventArgs e) { //To pass the column index and row index of current record int columnIndex = e.Inner.ColIndex; int rowIndex = e.Inner.RowIndex; //Console.WriteLine(GetRecordValue(rowIndex, columnIndex)); MessageBox.Show(GetRecordValue(rowIndex, columnIndex)); } //To Get the cell value of current record private string GetRecordValue(int rowIndex, int columnIndex) { string cellValue = string.Empty; //To get the style of current cell GridTableCellStyleInfo style = this.gridGroupingControl1.TableControl.GetTableViewStyleInfo(rowIndex, columnIndex); if (style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell) { Record record = style.TableCellIdentity.DisplayElement.GetRecord(); //To get the cell value of current cell cellValue = record.GetValue(“Date”).ToString(); } return cellValue; } |
Screenshot
Sample Link
Regards,
Arulpriya