Last Updated: 20 Mar 2019 14:26 by ADMIN
Created on: 14 Mar 2019 15:51
Category: Grid
Type: Bug Report
RadGrid export to excel throws exception Index was outside the bonds of the array
When there is at least one ColumnGroup which is not assigned to any of the columns in RadGrid, exporting to Excel throws an exception "Index was outside the bonds of the array"
1 comment
Attila Antal
Posted on: 14 Mar 2019 15:56
The only workaround at the moment is to remove the ColumngGroup if not in use.

<telerik:RadGrid ID="RadGrid1" runat="server">
    <ExportSettings IgnorePaging="true" ExportOnlyData="true">
        <Excel Format="Xlsx" />
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="OrderID" CommandItemDisplay="Top">
        <CommandItemSettings ShowExportToExcelButton="true" />
            <telerik:GridColumnGroup Name="Group1" HeaderText="Group 1"></telerik:GridColumnGroup>
            <telerik:GridBoundColumn DataField="OrderID" DataType="System.Int32"
                FilterControlAltText="Filter OrderID column" HeaderText="OrderID"
                ReadOnly="True" SortExpression="OrderID" UniqueName="OrderID">
            <telerik:GridDateTimeColumn DataField="OrderDate" DataType="System.DateTime"
                FilterControlAltText="Filter OrderDate column" HeaderText="OrderDate"
                SortExpression="OrderDate" UniqueName="OrderDate">