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
65
Databinding and persisting data question
posted

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. 

Parents
No Data
Reply
  • 19308
    posted

    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

Children