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?
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
I looked at the sample, but it doesn't seem to do what I'm trying to accomplish. I was hoping that once I entered data into the "Add" row, I would be able to press the "Submit Data" button and the data would be saved to the grid...but it isn't. It seems to only save the newly added row if the tab or enter keys are pressed. Is there any way to get the new row added simply by pressing the "submit" button?