I'm loading an UltraWebGrid control thats bound to a SqlDataSource. I then filter the SqlDataSource and databind the UltraWebGrid and the grid displays as expected. The user then make changes to the grid and then clicks on an urelated button on the form. When this happens, the grid reloads without retaining any changes or previously applied filter. How can I have the user click the button without the grid reolading and loosing any previously entered user data?
Thanks in advance for any replys.
I'm guessing you're using the UpdateRowBatch event on the grid. That event will defer firing until the page is posted back through some other mechanism. Unfortunately, any postback will trigger the updaterowbatch event to fire. Once the event fires, you have to push the changes to your database, or they will be lost. The workaround is to make sure that the grid never get's posted back until you're ready to handle the data changes. You can do this with AJAX by wrapping other controls in an UpdatePanel. For example, your button (and any controls it needs to modify during the postback) would go into an UpdatePanel, so that they can be posted back separately from the grid control.
Hope this helps,
-Tony
Wrapping the other controls in an update panel works, but how would I handle the user clicking on of the grid buttons? I don't want to commit changes to the database simply because the user hit a "lookup button" on the grid. Is there no way to set a trigger event for the update batches?