Hi,
I am using BeforeRowUpdate to validate and save (or not) my user's current row of data.
The problem I have is when we add a new row. The grid is bound to a DataTable. We give them an add new row button and it adds an initialized row of data to the data table and then we expect them to add the missing data elements. We expect that when they move off the row, it will fire BeforeRowUpdate and save the data.
However, the BeforeRowUpdate event does not fire for this new row, only on existing rows. What event should I be using to decide when the user is done editing a new row?
Thanks,
Kent
Hi Kent,
Thank you for posting to our forums.
How exactly are you adding the new row? Is the user data added through the grid itself or through the data table? If it is added through the data table, no update events will be raised to the grid (it will just update its interface). You could consider using TemplateAddRow to add the data to the grid. Then the BeforeRowUpdate event will be raised and you can initialize the default data for the row in the InitializeTemplateAddRow event. If the data is added through the UltraGrid and the BeforeRowUpdate is not raised, please send me a small sample project that reproduces the issue and I will be glad to research it further.
I am looking forward to hearing from you.
Thanks for the reply Dimitar,
Yes I was adding a row to the DataTable to accomplish this goal.
Yes, what you say works, however it kind of changes the look/feel. Our users tend to resist changes to the interface implementations, but I think the benefits of using this method will be clear in short order. I have already changed the save to be automatic without clicking a button, (clearly a change to what my users are used to,) so this should be nonetheless as simple.
We'll run the change through as is and see how they like it.