Until recently I was exporting to Excel using ExcelML format. The GridEditCommandColumn was not exported (ExportOnlyData is set to true).
I am now exporting using XLSX format. Since then, the GridEditCommandColumn is exported along with data.
I would expect the same behaviour (no edit column).
Is it a bug ?
Is there an option to hide GridEditCommandColumn when exporting to xlsx ?
<
telerik:RadButton
ID
=
"ButtonExportExcelML"
runat
=
"server"
Text
=
"Export to ExcelML"
OnClick
=
"ButtonExportExcelML_Click"
/>
<
telerik:RadButton
ID
=
"ButtonExportXLSX"
runat
=
"server"
Text
=
"Export to XLSX"
OnClick
=
"ButtonExportXLSX_Click"
/>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AutoGenerateColumns
=
"true"
ExportSettings-ExportOnlyData
=
"true"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
protected
void
RadGrid1_NeedDataSource(
object
sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
RadGrid1.DataSource =
new
List<
int
> { 1,2,3,4,5,6};
}
protected
void
ButtonExportExcelML_Click(
object
sender, EventArgs e)
{
RadGrid1.ExportSettings.FileName =
"TestExcelML"
;
RadGrid1.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
RadGrid1.ExportToExcel();
}
protected
void
ButtonExportXLSX_Click(
object
sender, EventArgs e)
{
RadGrid1.ExportSettings.FileName =
"TestXlsx"
;
RadGrid1.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx;
RadGrid1.ExportToExcel();
}