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
345
How to populate identity column in grid after adding new row?
posted

 I have a grid bound to a table with three columns, the first being the identity column. All three columns are visible in grid. I am using the webgrid designer to generate SQL CRUD and enable adding/deleting/updating. Its all working fine.

 I also have AJAX enabled. When I add a new row, the identity column in the grid is not being filled in with the SQL Server generated value. How do I get that value to populate in the grid? 

 If I disable Ajax or if I click on another button that causes postback, then the ID value gets filled in the grid... but I'd like to have that value filled immediately after an add with ajax enabled. Is it possible with ajax enabled to have just add row do a full page postback?

 Thanks for the help.