exportToExcel client side not functioning with column renderers

4 posts, 0 answers
  1. Roatin Marth
    Roatin Marth avatar
    65 posts
    Member since:
    Nov 2007

    Posted 15 Nov 2010 Link to this post

    Greetings folks,
    I'm using the client side exportToExcel function like so: gridView().exportToCsv().
    The csv that gets generated doesn't contain all of the expected data I see on the grid. 
    The problem is I'm using column renderers on these fields to interpret numerical values and display them as text in english.
    For some reason the exportToCsv only includes the underlying numerical data.

    Is there anyway around this?
    Or do I just have to bind the text data to the grid...

    thanks
  2. Marin
    Admin
    Marin avatar
    1045 posts

    Posted 19 Nov 2010 Link to this post

    Hi Roatin,

    This is not a standard supported scenario. The exportToCsv() raises a postback event to perform exporting for the grid server side. That is why the client-side changes are not reflected in the exported format. So basically the exported data is what the grid is bound to.
    You are right that one possible option is to directly bind the grid server-side and transform the data there. This way the export will pick up the correct data format. For more information on exporting in the CSV format you can check this help article.

    All the best,
    Marin
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Roatin Marth
    Roatin Marth avatar
    65 posts
    Member since:
    Nov 2007

    Posted 17 Jan 2011 Link to this post

    ah, fraid of that

    there should be a means of just exporting what's being rendered on the grid, no?

    thanks
  5. Marin
    Admin
    Marin avatar
    1045 posts

    Posted 18 Jan 2011 Link to this post

    Hi Roatin,

    I am afraid the grid does not support such scenarios because any modifications made to the client side HTML are not persisted on the server and the export logic is executed only on the server. The changes you have made client side first have to be persisted so the export functionality can detect them. Note that the client-side exportToCsv() function does not contain a logic for exporting, it only raises a postback and the actual processing is done on the server which does not know about the client-side changes.

    All the best,
    Marin
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top