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
40
Headers and rowselectors looses style after refresh
posted

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?

Parents
No Data
Reply
  • 45049
    posted

    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.

Children