Hi Telerik,
We are facing an issue of Exporting to XSLS from RadGrid. We recently change our export functionality to XSXL. Currently, we are using
radgrid.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx;
Ihave a functionality to export selected records. When I select some of records from Grid and export them we are getting all the records are exported to xslx file NOT only selected.
The weird thing I faced is that when I change GridExcelExportFormat.Xlsx from GridExcelExportFormat.HTML, it works fine. (Only Selected Records are being exported)
I am using following code to export selected records.
if
(radgrid.SelectedItems.Count != 0)
{
foreach
(GridDataItem item
in
radEntityRecords.MasterTableView.Items)
item.Visible = item.Selected;
}
radgrid.ExportSettings.OpenInNewWindow =
true
;
radgrid.ExportSettings.ExportOnlyData =
true
;
radgrid.MasterTableView.IsFilterItemExpanded =
false
;
radgrid.ExportSettings.UseItemStyles =
true
;
radgrid.MasterTableView.GroupByExpressions.Clear();
radgrid.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx;
radgrid.MasterTableView.ExportToExcel();
Please suggest us,