Export to excel only checked rows

3 posts, 0 answers
  1. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 08 Jul 2014 Link to this post

    Hi,

    Sadly the search on the forum appears to be broken so I can't filter it. Searching for Export shows 0 results.

    So on with my question.  Is there a way to only export any rows where the checkbox is ticked (or in the intermediate state where one of it's children have been ticked)?  Obviously I could parse the data creating my own excel file but hey I want the easy solution :)

    Regards

    Jon
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Jul 2014 in reply to Jon Link to this post

    Hi Jon,

    Please try the below C# code snippet to export only the checked rows of a RadTreeList.

    C#:
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        foreach (TreeListDataItem item in RadTreeList1.Items)
        {
            if (item.Selected == false)
            {
                item.Visible = false;
            }
        }
        RadTreeList1.ExportSettings.OpenInNewWindow = true;
        RadTreeList1.ExportToExcel();
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 08 Jul 2014 in reply to Shinu Link to this post

    Thanks Shinu,

    I was focusing more on handling the export event - which of course there doesn't appear to be one.  Your approach is nice and easy to drop into what I have already.  Many thanks :)

    Regards

    Jon
Back to Top