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
Hi Tony,
I am facing the same issue with the UpdateRowBatch event. You mentioned above to use AJAX but I have never used AJAX before, so is it possible for you to provide with with some sample code? I read on your website and you have described a solution for a later version of the webgrid but I needed this for version 2006 Volume 3 CLR 2.0.
THanks,
hs2
The WebGrid has had AJAX support dating back to 2004 actually. 2006 volume 3 supports AJAX updating - to enable it take a look at the following help topic - http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebGrid_Xml_Rendering_and_Xml_Load_on_Demand.html