We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

My own cell validation

Hi, I'm doing my own validation on various cells, and I can't get the focus to stay on the invalid cell if the user tabs out of that cell. This is what I'm doing: On OnCurrentCellEditingComplete, I do my validation on the current cell. When the cell data is invalid, I want to stay focused on that cell and ideally BeginEdit on the same cell again. How can I do this?

1 Reply

AD Administrator Syncfusion Team August 19, 2003 05:52 PM UTC

Instead of OnCurrentCellEditingComplete, use OnValidateCurrentCell instead. (Use CurrentCell.Renderer.ControlText to get the 'new' text value and do your validation on it.) If validation fails, set e.Cancel = true. You can also set CurrentCell.ErrorMessage if you want to display a message. Setting e.Cancel = true will force the currentcell to stay put.

Loader.
Up arrow icon