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
1910
Add row when button is pressed
posted

I have a WebDataGrid and am able to add a row if I insert the data and tab off or hit the enter key, but I have a save button outside of the grid that the users are used to pressing after they have updated existing records and I want them to be able to press this button when they have inserted new data to add a new row. Any suggestions?

Parents
No Data
Reply
  • 4315
    Offline posted

    Hi, Algunderson.

    If I understood you right, what you want to achieve is to add one or more rows to the grid and then by pressing Save button to send the new data to the server. If you want this you can check this sample.

    By default when you add a row to the grid after the new row looses focus, it automatically makes a postback to the server and saves the new row data in the data source. If you want to update several rows at once, without an automatic postback, you need to enable BatchUpdating behavior of the grid. With this behavior enabled, when the new row looses focus, no automatic postback happens. The save of the new data into the data source happens when you make the first postback to the server. The sample above shows you exactly that. I hope this will help you and if you have other questions, don't hesitate to ask them.

    Best regards,
    Nikolay

Children