Approved
Last Updated: 20 Mar 2019 14:26 by ADMIN
Doug
Created on: 14 Mar 2019 15:51
Category: Grid
Type: Bug Report
1
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
ADMIN
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" />
    </ExportSettings>
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="OrderID" CommandItemDisplay="Top">
        <CommandItemSettings ShowExportToExcelButton="true" />
        <%--<ColumnGroups>
            <telerik:GridColumnGroup Name="Group1" HeaderText="Group 1"></telerik:GridColumnGroup>
        ColumnGroups>--%>
        <Columns>
            <telerik:GridBoundColumn DataField="OrderID" DataType="System.Int32"
                FilterControlAltText="Filter OrderID column" HeaderText="OrderID"
                ReadOnly="True" SortExpression="OrderID" UniqueName="OrderID">
            </telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn DataField="OrderDate" DataType="System.DateTime"
                FilterControlAltText="Filter OrderDate column" HeaderText="OrderDate"
                SortExpression="OrderDate" UniqueName="OrderDate">
            </telerik:GridDateTimeColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>