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

How to Export Data of All Pages when Using RadGrid?

9 Answers 2171 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pooya
Top achievements
Rank 1
Pooya asked on 01 Apr 2011, 10:57 AM
My RadGrid is allowing paging in design mode and runtime e.g. returns 100 rows displayed in 5 pages with the size of 20.

When I export to Excel for example, it exports only the page which is displayed whereas I'd need to export all the data.

I tried setting the
RadGrid1.ExportSettings.IgnorePaging = true;
and
 
RadGrid1.MasterTableView.AllowPaging = false;

Before running the export function but still behaves the same way.

How could I achieve this?

9 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Apr 2011, 12:29 PM
Hello,

I am not quite sure about the exact scenario and I have found the following forums which discussed similar issue.

IgnorePaging=true not working on expot to excel.
Rad Grid Export Ignore paging

If it does not helps, please elaborate your scenario.

Thanks,
Shinu.
0
Daniel
Telerik team
answered on 06 Apr 2011, 10:09 PM
Hello Pooya,

This usually happens when using simple data-binding. You have to use advanced data-binding (or a datasource control) in order for this functionality to work properly:
Advanced data-binding

Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Pooya
Top achievements
Rank 1
answered on 07 Apr 2011, 02:15 PM
Thanks. I added a RadGrid_OnNeedSource() even and loaded all data there and it's sorted.
0
Asad
Top achievements
Rank 1
answered on 30 Mar 2014, 05:28 AM
Below Code works for me 

protected void dgvInquery_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToWordCommandName ||e.CommandName == Telerik.Web.UI.RadGrid.ExportToPdfCommandName||
                  e.CommandName == Telerik.Web.UI.RadGrid.ExportToExcelCommandName)
        {
            dgvInquery.AllowPaging = false;
            GetAllInqueries(); //contains viewstate of datatable to be binded with grid
            ConfigureExport();        
        }
        dgvInquery.AllowPaging = true;
      
    }

    public void ConfigureExport()
    {
        dgvInquery.ExportSettings.IgnorePaging = true;
        dgvInquery.ExportSettings.ExportOnlyData = true;        
        dgvInquery.ExportSettings.OpenInNewWindow = true;
        dgvInquery.ExportSettings.UseItemStyles = true;
        dgvInquery.ExportSettings.FileName = "Inqueries (" + DateTime.Now + ")"; 
    }
0
Daniel
Telerik team
answered on 01 Apr 2014, 04:20 PM
Hello Asad,

I'm glad to hear that you have found a solution. I'd just like to note that you don't need to re-enable the paging as the current state won't be saved when exporting.
Let me know if you need more information.

Regards,
Daniel
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
Asutosh
Top achievements
Rank 1
answered on 24 Jun 2014, 05:47 AM
hi i am using onneeddatasource
still same problem with me

code

gridname.ExportSettings.FileName = "filename";
            gridname.ExportSettings.IgnorePaging = true;
            gridname.ExportSettings.ExportOnlyData = true;
            gridname.ExportSettings.OpenInNewWindow = true;
            gridname.MasterTableView.UseAllDataFields = true;
            gridname.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;

            gridname.MasterTableView.HierarchyDefaultExpanded = true;
            gridname.MasterTableView.DetailTables[0].HierarchyDefaultExpanded = true;

            gridname.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
            gridname.MasterTableView.DetailTables[0].HierarchyLoadMode = GridChildLoadMode.Client;

            gridname.MasterTableView.ExportToExcel();
0
Daniel
Telerik team
answered on 26 Jun 2014, 08:49 AM
Hello Asutosh,

Please examine the suggestion of my colleague here:
http://www.telerik.com/forums/selfhierarchy-exporttoexcel-and-exporttoword-problem

Here is my last answer:
www.telerik.com/community/forums/export-to-excel-for-a-rad-grid-with-hierarchical-data

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
J V
Top achievements
Rank 1
answered on 17 Nov 2016, 06:20 AM

i got solution with this code thank you so much i helps a lot to me.

my solution if we want to export data for all pages of radgrid ,after binding the data to radgrid statement use this line

rdgridid.ExportSettings.IgnorePaging=true; 

 

or 

 

use which asad's code also  will get solution

0
Dhruval
Top achievements
Rank 1
answered on 10 Mar 2017, 05:13 AM

Hello Daniel,

radGrid.ExportSettings.IgnorePaging=true; 

It's working for me.

 

Thanks,

Dhruval

Tags
Grid
Asked by
Pooya
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Daniel
Telerik team
Pooya
Top achievements
Rank 1
Asad
Top achievements
Rank 1
Asutosh
Top achievements
Rank 1
J V
Top achievements
Rank 1
Dhruval
Top achievements
Rank 1
Share this question
or