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

Export all records to excel when I'm using RadDataPager for paging

2 Answers 202 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pankaj
Top achievements
Rank 1
Pankaj asked on 25 May 2011, 07:53 AM
Hi,
 
How can I export all the records to excel, when I'm using RadDataPager for paging.

Currentl when I export it export only the records which are currently displayed in grid.

Thanks,
Pankaj

2 Answers, 1 is accepted

Sort by
0
Thomas LEBRUN
Top achievements
Rank 1
answered on 02 Jan 2012, 04:35 PM
I have the exact problem: i'm exporting a RadGridView to Csv (bind to an IQueryable) and the export only displays the rows shown in first page.

How can i get all the items to be exported ?

Thanks !
0
Dimitrina
Telerik team
answered on 03 Jan 2012, 08:24 AM
Hi Thomas,

If I have understood you right, basically what you should do is:

1. Save the PageSize and the PageIndex of the dataPager.
2. Set the PageSize of the dataPager to 0. 
3. Then export the data ((IEnumerable) dataPager.PagedSource ). 
4. Set the PageSize and the PageIndex back.

I hope that this is what you need. 

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Pankaj
Top achievements
Rank 1
Answers by
Thomas LEBRUN
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or