Export GridView CommonGroupHeaders

3 posts, 0 answers
  1. Renier Pretorius
    Renier Pretorius avatar
    46 posts
    Member since:
    Apr 2010

    Posted 10 Sep 2015 Link to this post


    I have gridview in which I added some common group headers to group the columns logically. Depending on the context some of these logical groups have no data and therefore I hide them in the UI (IsVisible=false on DataLoaded event). On exporting the grid to Excel (.ExportToXlsx method) the Group Headers does not line up with the relevant columns. I put this down to the hidden columns so my solution was to first show all the columns (IsVisible=true), do the export and then hide the relevant empty columns again. However, now none of the group headers are exported.

     I capture the ElementExportingToDocument event and can see a CommonColumnHeaderRow element being exported but no CommonColumnHeaderCell element or the like (next element is HeaderRow).

    Any thoughts?

  2. Renier Pretorius
    Renier Pretorius avatar
    46 posts
    Member since:
    Apr 2010

    Posted 10 Sep 2015 in reply to Renier Pretorius Link to this post


    I have moved showing all columns to before calling the FileDialog for the destination and now it works as expected. So it seems like a timing issue.

    While this addresses my workaround, ideally I would like not to export the empty columns but be able to keep the headers lined up

  3. DevCraft banner
  4. Stefan X1
    Stefan X1 avatar
    486 posts

    Posted 15 Sep 2015 Link to this post

    Hi Renier,

    I am glad that you managed to find a resolution to the question from your first post.

    As to your second requirement, we have it already logged in our Bug tracking system. You can track its progress in the Feedback portal: Add support for disabling the export of a particular column.

    Do not hesitate to contact us in case you have any other questions on our controls.

    Best Regards,
    Stefan X1
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top