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
314
Initial View is exported only when load-on-demand is enabled
posted

Hi,

 I have a gridview with load-on-demand is enabled. When the grid is exported with excel exporter, only the rows that were visible during the initial load are exported. Is this a limitation with loading?

Parents
No Data
Reply
  • 45049
    Verified Answer
    posted

    Yes, this is a limitation of WebGridExcelExporter.  It will only export those rows that exist in the grid, and when you have the grid's AJAX functionality turned on, it only has the first set of rows available.  The same occurs with the grid's paging functionality; the grid only has the current page's data available.

    To get around this, turn off the grid's AJAX and paging features, call DataBind() on the grid, and then export.  As long as you're not using any of the "custom" download modes of the WebGridExcelExporter, you don't even have to reset these values to their previous values - your Excel file will be the response sent to the client, so the client never finds out about the changes you made on the server.

Children
No Data