Export selective columns

2 posts, 0 answers
  1. Johan
    Johan avatar
    1 posts
    Member since:
    Oct 2011

    Posted 10 Dec 2014 Link to this post

    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
  2. Angel Petrov
    Admin
    Angel Petrov avatar
    1006 posts

    Posted 15 Dec 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top