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

Export selective columns

1 Answer 48 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Johan
Top achievements
Rank 1
Johan asked on 10 Dec 2014, 11:00 AM
Hi

My RadTreeList has seven columns and I have added functionality to Export the treelist to Excel. How can I exclude a column for being exported, i.e. I have columnA, columnB, columnC, columnD, columnE, columnF, and columnG but when exporting, I do not want columnF to be exported.

Is this possible? If yes, sample code would be appreciated

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 15 Dec 2014, 07:49 AM
Hi Johan,

In order to achieve the desired goal you can hide the column before the export is triggered. If you are using an external button to trigger the export you can do something like this.

C#:
protected void Button_Click(object sender, EventArgs e)
    {
        RadTreeList1.GetColumnSafe("columnF").Visible = false;
        RadTreeList1.ExportToExcel();
        RadTreeList1.Rebind();
    }


Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TreeList
Asked by
Johan
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or