I have several pages where I use the WebGrid placed inside either a AJAX Updatepanel or a Web Async Refresh Panel. But after a refresh (inserting new rows, removing rows, etc.) the WebGrid looses its styleformat.
EnableViewState is set to true on the page, updatepanels and webgrid..
Is this a known problem?
I've seen this before, if you're stying WebGrid using its Style properties.
If I understand correctly, the reason for this is because WebGrid emits dynamic CSS to the page when you set its Style properties, to account for the appearance. This dynamic CSS isn't handled by either the UpdatePanel or the WARP, nor do I know of a way to make either panel do so. The result is that the appearance of the grid is partially or completely lost during the panel's asynchronous callback.
The best solution I know of is to use CSS to style WebGrid, rather than its Style properties. You can have the CSS classes defined either in a page or in a separate file, so long as those CSS classes are availalbe to the browser when the page initially renders. WebGrid will then simply pass references to those CSS classes in the appropriate locations, and will find the corresponding classes on the browser.
We're using CSS to style the WebGrid. This "error" came with the 8.1 version of the components. I guess. At least that's when I first experienced it..