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

How to get column filter option on BIFF export to Excel

1 Answer 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 17 Jan 2018, 06:54 PM

Hi.  I'm using Telerik 2016.3.1027.40.  I need to export an Excel spreadsheet in BIFF that includes both the data that appears in a UI table, which Telerik handles, and any table filtering criteria and the filtering option (Contains, StartsWith, EqualTo, Between, etc.) on an additional tab on the worksheet.  I can create the additional tab and population it with data.  My question is:  is it possible to retrieve the filtering option used per column (if any) in the UI in the view's code behind?

 

<telerik:Radgrid Rendermode="Lightweight" ID="RadGrid1" runat="server" showstatusbar="true" autogeneratecolumns="False" AllowFilteringByColumn="True" pagesize="10" allowsorting="True" allowmultirowselection="False" allowpaging="True" Filtertype="Combined"  onneeddatasource="RadGrid1_NeedDataSource"   oniteminserted="RadGrid1_ItemInserted" onitemcommand="RadGrid1_ItemCommand" oninsertcommand="RadGrid1_InsertCommand" onupdatecommand="RadGrid1_UpdateCommand" onitemdatabound="RadGrid1_ItemDataBound" ondetailtabledatabind="RadGrid1_DetailTableDataBind" OnDeleteCommand="RadGrid1_DeleteCommand" Skin="Outlook" OnItemCreated="RadGrid1_ItemCreated" ShowExportToExcelButton="true" onBiffExporting="RadGrid1_BiffExporting">   
<MasterTableView  AutoGenerateColumns="False" UniqueName="CATDESCRIPTION" AllowMultiColumnSorting="True" DataKeyNames="CAT_DESCRIPTION" PagerStyle-AlwaysVisible="true" EditMode="InPlace" CommandItemDisplay="Top">
<DetailTables>
   <telerik:GridTableView DataKeyNames="pk" Name="Codes" TableLayout="Auto" EditMode="InPlace" PagerStyle-AlwaysVisible="true" CommandItemDisplay="Top">
<CommandItemSettings ShowExportToExcelButton="true" />
<CommandItemSettings AddNewRecordText="Add Rule" />
Additional code omitted...

 

and the code behind something like this...

protected void RadGrid1_BiffExporting(object o, GridBiffExportingEventArgs e) {
  Telerik.Web.UI.ExportInfrastructure.Table newSheet1 = new Telerik.Web.UI.ExportInfrastructure.Table("Metadata");
  // Get filtering options here...
  // Add filtering options to newSheet1 in new cells...

   e.ExportStructure.Tables.Add(newSheet1);
}

1 Answer, 1 is accepted

Sort by
0
Matthew
Top achievements
Rank 1
answered on 29 Jan 2018, 03:24 PM
Does anyone have any insight into how I might accomplish this?
Tags
Grid
Asked by
Matthew
Top achievements
Rank 1
Answers by
Matthew
Top achievements
Rank 1
Share this question
or