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

Export to excel only checked rows

2 Answers 69 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 08 Jul 2014, 10:20 AM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Jul 2014, 11:22 AM
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.
0
Jon
Top achievements
Rank 1
answered on 08 Jul 2014, 11:30 AM
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
Tags
TreeList
Asked by
Jon
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jon
Top achievements
Rank 1
Share this question
or