3
votes

I'm using RadGrid from Telerik (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. With grid.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 Telerik is writing to excel but can't figure out how to do this..

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

1
What is the issue w/ the data in grd.DataSource ? - Christopher Rathermel
tha DataSource property will give you the original data. Not sorted or filtered. - stian.net

1 Answers

0
votes

I guess you could be able to do this by inspecting the code in ExportToExcel, and hooking on some logic to the MasterTableView, but I really don't think there are any 'standard' way of doing this..