Leave cell when TableControlCurrentCellValidating event fails

Please help!

I am validating an entry in the TableControlCurrentCellValidating event.
I would like to be able to set e.Inner.Cancel = true and reset the cell value to its original value(which is easy enough) and still be able to leave the cell.

However, setting e.Inner.Cancel = true does not allow me to leave the current cell until I correct the cell value.

2 Replies

AD Administrator Syncfusion Team September 6, 2006 10:32 AM UTC

Hi James,

Try this code snippet to resolve this.

private void TableControlCurrentCellValidating(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;

if (cc.Renderer.ControlText == "Invalid" )
{
//To get/set the new cellvalue from cc.Renderer.ControlText:
//To get the old cellvalue from e.TableControl.Model[cc.RowIndex,cc.ColIndex ].Text
cc.Renderer.ControlText = e.TableControl.Model[cc.RowIndex,cc.ColIndex ].Text;
}
}

Let me know if this helps.
Best Regards,
Haneef


JA jamesb September 6, 2006 01:51 PM UTC

works!
thx Haneef

Loader.
Up arrow icon