Exporting hidden column

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

    Posted 30 Sep 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
    1488 posts

    Posted 05 Oct 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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top