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

Exporting the all data when using virtualitemcount

1 Answer 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bharat
Top achievements
Rank 1
Bharat asked on 05 Feb 2014, 11:35 AM
I am showing details for a single page at a time, but i need to export all records

Please suggest on this.

Thanks & Regards
Bharat

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Feb 2014, 12:20 PM
Hi Bharat,

When setting VirtualItemCount property of the RadGrid, you need to set the PageSize to this property during the Export to have all the pages Exported.

C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
 if (e.CommandName == RadGrid.ExportToExcelCommandName)
  {
    RadGrid1.PageSize = RadGrid1.MasterTableView.VirtualItemCount;
    RadGrid1.ExportSettings.ExportOnlyData = true;
    RadGrid1.ExportSettings.IgnorePaging = true;
    RadGrid1.ExportSettings.OpenInNewWindow = true;   
  }
}

Thanks,
Princy
Tags
Grid
Asked by
Bharat
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or