We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Menu filter and excel filter in one grid

Is it possible to have both "menu filter" and "excel filter" in one grid?
For example "menu filter" for Column A and "excel filter" for Column B.


5 Replies

MS Mani Sankar Durai Syncfusion Team July 14, 2016 10:25 AM UTC

Hi Pawel, 

Thanks for contacting Syncfusion support, 

Yes, we can enable both excel and menu filter for different columns. We can achieve it by using the FilterType property of columns as either menu or excel for the particular column.  

For your convenience please refer the below code example, 

 
$("#Grid").ejGrid({ 
                    … 
                    allowFiltering: true, 
                    filterSettings: { filterType: "excel" }, 
                    columns: [ 
                            { field: "OrderID", isPrimaryKey: true, headerText: "Order ID", textAlign: ej.TextAlign.Right, width: 75 }, 
                            { field: "CustomerID", filterType: "menu", headerText: "Customer ID", width: 120 }, 
                    ]  
                }); 
                }); 

We have also prepared a sample that can be downloaded from the below link, 
 

Please let us know if you need further assistance. 

Regards, 
Manisankar Durai. 



VM Vishal Manghnani August 5, 2016 04:20 PM UTC

Hi Could you post a sample for doing this without javascript?
I tried it by setting the grid property .AllowFiltering() and then set FilterType property of a column as col.Field(p => p.ClientName).HeaderText("Client Name").FilterType(FilterOption.Excel).Add(); 
The column client name still showed as a Text box rather than an excel type drop down

Thanks


MS Mani Sankar Durai Syncfusion Team August 8, 2016 10:48 AM UTC

Hi Pawel, 
 
We have analyzed your query and found the cause of the issue. You have initialized the filterType as excel for one column and not initialized the filterSettings to have the filterType as menu for other columns. This is the cause of the issue. If you enable the filterType as filterBar which is common for all columns and set the filterType as excel or menu for particular columns it will show as filterBar (Textbox). So we suggest you to mention the filterSettings to render the filterType as either menu or excel for other columns. 
Please refer the below code example, 
[Index.cshtml] 
@(Html.EJ().Grid<object>("Grid") 
          
        .AllowFiltering() 
        .FilterSettings(filter => { filter.FilterType(FilterType.Menu); }) 
        .Columns(col => 
        { 
            
col.Field("Freight").HeaderText("Client Name").FilterType(FilterOption.Excel).Add();  
        }) 
) 

We have also prepared a sample that can be downloaded from the below link, 

Please let us know if you need further assistance 
Regards, 
Manisankar Durai 



CL Clovis February 17, 2018 05:19 PM UTC

Hi

Is it possible to have FilterBar as grid filtering option and Excel or Menu for specific columns ?

Thanks


BM Balasubramanian Masilamani Syncfusion Team February 19, 2018 10:34 AM UTC

Hi Clovis, 

Thanks for contacting Syncfusion support. 

We have checked your query and found that you want to use filterBar as grid filterType and with Menu or Excel filter as filterType for specific columns. Since it is not feasible by setting the menu or excel as column filterType when the grid contains the filterType as filterBar . If you need to use either Menu filter or excel filter for specific columns, we suggest you to use Menu filter or Excel filter as grid filterType. 
 

Please let us know if you need further assistance. 
 
 
Regards, 
Balasubramanian Masilamani 





Loader.
Up arrow icon