This is a migrated thread and some comments may be shown as answers.

Exporting hidden column

1 Answer 668 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 1
Pierre asked on 30 Sep 2016, 12:43 PM

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 ?

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 05 Oct 2016, 09:12 AM
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.
Tags
Grid
Asked by
Pierre
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or