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.
Between these three events, where would be the best consistent place to do input validation and perform do manual manipulation to the underlying datasource?
Here are some requirements. I would like access to the column and row index of the cell, the old and new value of the cell, and the underlying datarowview or record.
Users will be using the up/down/left/right arrow keys to navigate and changin values quickly, i.e., the values in the cell are by selected by default.
ADAdministrator Syncfusion Team September 14, 2006 05:57 AM UTC
Hi James,
The recommended solution is to handle TableControlCurrentCellValidating event for validating the cell data in a grid. So, Please try these code and see if it helps.
GridCurrentCell currentCell = e.TableControl.CurrentCell; GridTableCellStyleInfo style = cc.Renderer.CurrentStyle as GridTableCellStyleInfo;
To get the RowIndex, use below code snippet. int RowIndex = currentCell.RowIndex;
To get the ColIndex, use below code snippet. int ColIndex = currentCell.ColIndex;
To get the OldValue, use below code snippet. object OldValue = style.CellValue;
To get the NewValue, use below code snippet. object NewValue = cc.Renderer.ControlValue;
To get the CurrentRecord, use below code snippet. Record rec = e.TableControl.Table.CurrentRecord;
To get the CurrentDataRowView from CurrentRecord , use below code snippet. Record rec = e.TableControl.Table.CurrentRecord; DataRowView drv = rec.GetData() as DataRowView;
Please refer to the below KB article for more details on Validation of a cell. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=340