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

Grab excel export data from grid

1 Answer 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
stian.net
Top achievements
Rank 1
stian.net asked on 09 Feb 2012, 04:02 PM

I'm using RadGrid (RadGrid.Net2 (I know I should upgrade to a newer version, but that is not an option here..)). One of it's features is to export data to excel. Withgrid.MasterTableView.ExportToExcel(); an excel file is created with filtered and sorted data from the grid (all pages). How can i grab this data?

grd.ExportSettings.ExportOnlyData = true;
grd.ExportSettings.IgnorePaging = true;
grd.MasterTableView.ExportToExcel();

I want to grab the same data as the grid is writing to excel but can't figure out how to do this..

grd.MasterTableView.GetExportDataAsDataTable() would be perfect ;)

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 14 Feb 2012, 10:41 AM
Hi Stian,

It is not possible to directly generate a dataset (or any other data container) from the exported data. Of course, you could implement this functionality on your own. Rebind the control, traverse all rows and fill your dataset manually from the table cells, ignoring all the unwanted data.

Regards,
Daniel
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Grid
Asked by
stian.net
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or