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

Export to Excel option

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
KS
Top achievements
Rank 1
KS asked on 17 Jan 2011, 10:02 AM
Export to excel option is working properly with grid with pages

I have set page size to 50 and actual rows are 1000+
Now when I take use export option, Excel is showing records for first page only and some distorted data in the bottom.

I have use following code:

private void ExportGridToExcel(Telerik.Web.UI.RadGrid radgrid1)
    {
        radgrid1.PageSize = 1000;
        radgrid1.Rebind();
        radgrid1.MasterTableView.ExportToExcel();
        radgrid1.PageSize = 50;
        radgrid1.Rebind();
    }

It also not working..

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Jan 2011, 11:20 AM
Hello,

You can set IgnorePaging property to true to avoid the paging before Exporting.

C#:
protected void Button2_Click(object sender, EventArgs e)
 {
     RadGrid1.ExportSettings.IgnorePaging = true;
     RadGrid1.MasterTableView.ExportToExcel();
 }

Please refer the following documentation for more on this.
http://www.telerik.com/help/aspnet-ajax/grdexport.html

Thanks,
Shinu.
Tags
Grid
Asked by
KS
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or