Show/hide grid filter bar fields dynamically

Hi, I would like to be able to have an external button that when pressed would show the grid filter bar fields on top of the columns. I've tried to run `_sfGrid.AllowFiltering = true` but that does not display the filter fields.

Is there any way to accomplish what I am trying to do? 

Thanks


3 Replies 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team February 23, 2022 02:23 PM UTC

Hi Timmy, 
 
Greetings from Syncfusion support. 
 
We suggest you to use property binding for the AllowFiltering property of Grid. Please refer and use as like the codes below, 
 
 
<SfButton OnClick="OnClick">Change filter state</SfButton> 
 
<SfGrid TValue="OrdersDetails" ... AllowFiltering="@AllowFilteringState"> 
    ... 
</SfGrid> 
 
    public bool AllowFilteringState = false; 
    public void OnClick() 
    { 
        AllowFilteringState = true; 
    } 
 
 
Please get back to us if you need further assistance. 
 
Regards, 
Renjith R 


Marked as answer

TI Timmy February 23, 2022 07:55 PM UTC

Thank you! That works



RS Renjith Singh Rajendran Syncfusion Team February 24, 2022 04:58 AM UTC

Hi Timmy, 
 
Thanks for your update. Please get back to us if you need further assistance. 
 
Regards, 
Renjith R 


Loader.
Up arrow icon