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
10
Initializing values in new row without doing update
posted

When I create a row by clicking on the new row button I tried handling the AddRow event and initializing several of the columns. This works fine for initializing the values. But by adding the AddRow handler my UpdateRow handler gets called immediately afterward (this is wrong - doesn't happen if I don't handle the AddRow event) and it tries to add the new row to the db. Which properly fails (I catch the exception) because data is missing, and the row state is pretty much messed up after that. Handling the AddRow event is the suggested way from the knowledge base, and it works great - up to a point.

 Any ideas on why adding an AddRow handler causes the UpdateRow event, or how to prevent it? Or another way to initialize the values in a new row?

I'm using the latest grid, version 8 for ASP.NET 3.5.

Thanks.

 -Gary