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
4165
What events fire after edting New Fixed Row at top of grid?
posted

Hello,

I have a grid configured to have a fixed add new row at the top of the grid. (acheived in the ultragrid designer, feature picker, updating, allow row adding)

What I want is to control WHEN that row is added to the grid. If all the fields are not filled out, I want to return the user to the row. Once the conditions are met, I want to add the row to the grid and then add it to the database.

What I need to know is what events fire in conjunction with this add new row?


Thanks,

M.

  • 469350
    Suggested Answer
    Offline posted

    Hi,

    The thing to do is handle the BeforeRowUpdate event of the grid. This event will fire before a row is committed to the grid by the user or in code. It will fire for new rows as well as existing rows. So in order to tell which one you are dealing with, you can check grid.ActiveRow.IsAddRow. This will be true for a new row and false for an existing row.

    You can cancel the event by setting e.Cancel to true. And what happens when you cancel is determined by the RowUpdateCancelAction property on the grid.