Exporting hidden column

2 posts, 0 answers
  1. Pierre
    Pierre avatar
    57 posts
    Member since:
    Jun 2016

    Posted 30 Sep 2016 Link to this post

    HI,

     

    Displaying my data in my grid i used few templated column.
    They are gather mutiple field and display them nicely. Like : Name - Surname
    But for my Exel Export , I need to split those information into 2 column.
    To apply filter in exel ect..

     

    <telerik:GridTemplateColumn UniqueName="PRD_exp" Exportable="true"
                        HeaderText="Info1<br/>Info2" >
        <ItemTemplate>
            <%#((myDataTYPE)Container.DataItem).Info1 %>
            <br/>-<br/>
            <%#((myDataTYPE)Container.DataItem).Info2 %>
        </ItemTemplate>
    </telerik:GridTemplateColumn>


    So my EXEL Export i want those information to be in different column.
     So i have set my Templated Column to Exportable="false" , and create hidden Column set visible="false" for each data in each Templated Column.
     Like this:
    <telerik:GridBoundColumn DataField="Info1" UniqueName="Info2"
                      Exportable="true"  Visible="false" />
    <telerik:GridBoundColumn DataField="Info2" UniqueName="Info2"
                      Exportable="true"  Visible="false" />

    What is the simpliest way to achieve this ?

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1741 posts

    Posted 05 Oct 2016 Link to this post

    Hello Pierre,

    In order to export the hidden columns in RadGrid you can use the Display property to hide them. When the data being exported you need to set Display to true. Check out the following thread that discusses the approach:




    Regards,
    Viktor Tachev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top