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
close icon

Set different filter types

Dear support,

Is it possible to set different filter types for multiple columns?
For example i have three columns: Name: string, Active: boolean, Age: number and i want filterbar type for Name and Age and checkbox filter type for Active.

And if i set "allowFiltering" to false on a column when the type is filterbar is there a way to make it invisible?

Thanks in advance,
David

3 Replies

DR Dhivya Rajendran Syncfusion Team September 2, 2019 04:16 AM UTC

Hi Horváth, 

Greeting from syncfusion. 

Query: Is it possible to set different filter types for multiple columns? 

Yes, you can use different filter types for columns in Grid. Please refer the below help documentation for more information. 


Query: And if i set "allowFiltering" to false on a column when the type is filterbar is there a way to make it invisible? 
 
We have analyzed your requirement and we suggest you to use the below way to achieve this. Please refer the below code example and sample for more information. 

In the below sample, we have bind the created event and set visibility hidden for the filterbar element. 

created(args){ 
  // set visibility hidden based on the column index 
  this.grid.getHeaderTable().querySelectorAll('.e-filterbarcell')[0].querySelector('.e-filterdiv').style.visibility = "hidden" 
} 



Regards, 
R.Dhivya 



HO Horváth September 2, 2019 01:41 PM UTC

Thank your for your quick answer!

The second query helped me, but the first does not work if the grid type is set to "FilterBar". 


KM Kuralarasan Muthusamy Syncfusion Team September 3, 2019 12:44 PM UTC

Hi Horváth, 
 
From your query, we found that you want to use “FilterBar and “CheckBox” filter both are in the same Grid. But it is not feasible to use the “FilterBar” with any other Grid filters. Due to avoid the UI related issues we have prevented this action by default in Grid. 
 
Regards, 
Kuralarasan M 


Loader.
Live Chat Icon For mobile
Up arrow icon