Hi
I would like to suppress the new template row add to the grid when the existing template row is not filled with valid data. Which event should I cancel to suppress the new template row at the bottom?
Also, I see that RowEditTemplateRequested event is not fired at all.
Is this order of firing these events?
1) RowEditTemplateRequested
2) IntializeTemplateAddRow,
3) BeforeRowEditTemplateDisplayed
Thanks
Simple enough. Works great. Thanks
Hi,
One thing you could try is handling BeforeRowDeactivate. You could check IsAddRow and if it's true, call CancelUpdate on the row.
Yes, by saving I mean commiting the data to the db.
This is how I would like the grid to behave:
When row.IsAddRow == false
So the only issue really is how to prevent the AddRow from being commited when the user does not press Return/Enter or tabs out of the row. The problem is that in BeforeRowUpdate for the AddRow I don't know if the user is moving away from the row or has pressed Enter.
I don't understand... What exactly do you mean by "I try to save the row in the BeforeRowUpdate". What exactly are you saving? You don't have to manually write the grid data to the data source, the grid will do this automatically. Do you mean you are writing the data to the back end?
BeforeRowUpdate should still fire, whether the row is a new row or an existing row. You can check row.IsAddRow to see which one it is.