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
585
UltraGrid Won't Add New Row
posted

I have a UltraGrid 9.2  grid that uses a BindingSource that is backed up by simple LINQ query.

The grid updates and deletes are working fine. I am having problems when tabbing off of the "new row". It is not letting me do that. I have filled in all data fields programmatically with valid data but the grid will not let me tab off of that row. If I modify any field on that row then I can tab off of the row and it is marked as dirty, therefore allowing me to save it to the database. I get no warning about why I cannot tab off of that row, it just won't do it. I can find no event being raised where I can warn the user.

Another problem occurs if I do not fill in the fields with valid data on a new row. Some of these columns are marked at not nullable. If I leave these as blank in the grid I would like to warn the user that they need to fill in valid data for that field before trying to commit to the database. Right now it just stops in the last column, not tabbing to the next row and not warning the user.

Thanks for your help.

Steven

Parents
  • 469350
    Offline posted

    Hi Steven,

    I'm not sure I understand the distinction you are making here. You say that you cannot tab out of the addnew row in the grid. And then you say that you CAN tab out if you modify a field in that row.

    So I think you are saying that you can't tab out when you set fields programmatically, but you can tab out if you edit the fields via the UI. Is that right?

    If that's the case, then my guess is that you need to mark the row as modified by the user. The TemplateAddRow doesn't become a "real" row until the user edits it. So what you have to do is set AddRowModifiedByUser to true on the row's ParentCollection. You can do this at the same time you are setting the values of the required fields in your code.

Reply Children