Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Validation events
posted

How do I suppress the built-in validation in the UltraGrid for constraitns on DataTables (e.g. unique columns)? I need to allow the user to put in "invalid" data to a cell, but not leave the row. This means that I neither want to revert the value, nor keep the focus on that cell.

 Also, I couldn't find any reference to the event model for validation in the online documentation. Does anyone know where I'd find this?

Parents
  • 469350
    Verified Answer
    Offline posted

     Hi,

    By default, the gridwrites the contents of a cell to the underlying data source when the cell loses focus. So you won't be able to leave the cell in this case unless you change the grid's UpdateMode to something like OnRowChange or OnRowChangeOrLostFocus.This should allow the user to leave the cell, since the grid won't try to update the data source until they leave the row. 

    To handle errors in the grid, you can use the CellDataError event or the Error event (or possibly both). You would typically do any other validation in either the BeforeCellUpdate or BeforeRowUpdate events. 

Reply Children