This is a migrated thread and some comments may be shown as answers.

Issue with exporting filtered radGrid

3 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Denis
Top achievements
Rank 1
Denis asked on 27 Apr 2017, 02:50 PM
I have a grid with filtering, sorting, paging enabled.  I added Excel export to it as well.  Once data is loaded, Excel export works like a charm, however, I have an issue with exporting filtered grid. I apply a filter to column, then when I click Export button, CommandRow disappears, all the filter controls disappear, and that's it, no export.

 

My grid

<telerik:RadGrid ID="RadGridOpenCases"
                    runat="server"
                    AutoGenerateColumns="False"
                    DataSourceID="odsOpenCases"
                    AllowPaging="True"
                    PageSize="10"
                    AllowSorting="True"
                    AllowFilteringByColumn="true"
                    Skin="Bootstrap">
 
                    <ExportSettings ExportOnlyData="true" IgnorePaging="true"></ExportSettings>
 
                    <MasterTableView CellSpacing="-1"
                        DataKeyNames="CaseID"
                        DataSourceID="odsOpenCases"
                        EnableNoRecordsTemplate="True"
                        AllowFilteringByColumn="True"
                        CommandItemDisplay="Top">
 
                        <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
 
                        <Columns>
                            <telerik:GridBoundColumn DataField="casenumber" HeaderText="Case #" SortExpression="casenumber" UniqueName="casenumber" ItemStyle-Wrap="false" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
                            <telerik:GridBoundColumn DataField="subject" HeaderText="Case Name" SortExpression="subject" UniqueName="subject" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
                            <telerik:GridDateTimeColumn DataField="datereceived" HeaderText="Received" SortExpression="datereceived" PickerType="DatePicker" EnableTimeIndependentFiltering="true" DataFormatString="{0:MM/dd/yyyy}" />
                            <telerik:GridBoundColumn DataField="subdivisiondesc" HeaderText="Type" SortExpression="subdivisiondesc" UniqueName="subdivisiondesc" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
                            <telerik:GridBoundColumn DataField="categorydesc" HeaderText="Category" SortExpression="categorydesc" UniqueName="categorydesc" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
                            <telerik:GridBoundColumn DataField="subcategorydesc" HeaderText="SubCategory" SortExpression="subcategorydesc" UniqueName="subcategorydesc" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
                            <telerik:GridBoundColumn DataField="assignedto" HeaderText="Assigned To" SortExpression="assignedto" UniqueName="assignedto" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
                            <telerik:GridBoundColumn DataField="casedoccount" HeaderText="" SortExpression="casedoccount" UniqueName="casedoccountid" AllowFiltering="false" />
                        </Columns>
 
                        <NoRecordsTemplate>
                            <p style="padding: 20px;">No cases to display</p>
                        </NoRecordsTemplate>
                    </MasterTableView>
 
                    <GroupingSettings CaseSensitive="false" />
 
                    <ClientSettings EnableRowHoverStyle="true"
                        EnablePostBackOnRowClick="true">
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>
 
                </telerik:RadGrid>
My code-behind
Protected Sub RadGridOpenCases_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles RadGridOpenCases.ItemCommand
    If e.CommandName = RadGrid.ExportToExcelCommandName Then
        RadGridOpenCases.ExportSettings.Excel.Format = GridExcelExportFormat.Biff
        RadGridOpenCases.ExportSettings.IgnorePaging = True
        RadGridOpenCases.ExportSettings.ExportOnlyData = True
        RadGridOpenCases.ExportSettings.OpenInNewWindow = True
        RadGridOpenCases.ExportSettings.FileName = "Dashboard"
    End If
End Sub

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 02 May 2017, 09:05 AM
Hi Denis,

Currently, the filtering export is supported only when GridExcelExportFormat is ExcelML, thus I will advise that you consider switching to it in order to utilize this functionality:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/exporting/export-formats/excelml-export/excelml-basics

Regards,
Vessy
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Denis
Top achievements
Rank 1
answered on 02 May 2017, 04:21 PM
My grid was inside of an asp:UpdatePanel.  Once I removed that, filtered export started working.
0
Vessy
Telerik team
answered on 05 May 2017, 12:24 PM
Hi,

Thank you for the update, Denis - I am glad you have managed to find the root of the problem. Hopefully this information will be helpful for the other developers in our community facing the same problem.

Kind regards,
Vessy
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Denis
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Denis
Top achievements
Rank 1
Share this question
or