AD
Administrator
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
Let me know if you need any further assistance.
Best Regards,
Haneef