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
380
Null while adding new rows
posted

Hello

I'm using the Nullable property = "Disallow" to force the user to enter information at the required columns. But i see it is only working on updates (user edits a cell and removes the content from it), and not with new rows, as the user can just tab away from the required cell without entering anything.

Am i missing a property here?

  • 69832
    Verified Answer
    Offline posted

    My guess is the grid intentionally relaxes that condition for AddNew rows because otherwise the user would be hampered in their attempts to navigate around the cells, i.e., they would be forced to enter the data into the cells in a certain order.

    UltraGridRow exposes a property, 'IsAddRow', which will return true for a newly added row. You could handle the BeforeExitEditMode event, check the 'IsAddRow' property (on UltraGrid.ActiveCell.Row), and set the Cancel property of the event arguments to true if the cell has no value.