I'm basing my code from the GridView Exporting Paged Data example of your web site Demo.
Please Advise
Here is an example of my code:
string extension = ((TextBlock)(((System.Windows.Controls.ListBox)btnExport.DropDownContent).SelectedItem)).Text.ToString();
ExportFormat format = ExportFormat.Html;
switch (extension.ToUpper())
{
case "HTML":
format = ExportFormat.Html;
break;
case "XLS":
format = ExportFormat.ExcelML;
break;
case "TXT":
format = ExportFormat.Text;
break;
case "CSV":
format = ExportFormat.Csv;
break;
}
dialog.DefaultExt = extension;
dialog.Filter = String.Format("(*.{0})|*.{0}|All files (*.*)|*.*", extension);
dialog.FilterIndex = 1;
if (dialog.ShowDialog() == true)
{
originalPageSize = radDataPager.PageSize;
originalPageIndex = radDataPager.PageIndex;
using (Stream stream = dialog.OpenFile())
{
radDataPager.PageSize = 0;
GridViewExportOptions exportOptions = new GridViewExportOptions();
exportOptions.Format = format;
exportOptions.ShowColumnFooters = true;
exportOptions.ShowColumnHeaders = true;
exportOptions.ShowGroupFooters = true;
exportOptions.Items = (IEnumerable)radDataPager.PagedSource;
radGrid.Export(stream, exportOptions);
}
radDataPager.PageSize = originalPageSize;
radDataPager.PageIndex = originalPageIndex;
radGrid.Rebind();
}