Checkbox filter default to be unchecked when opening it

Hello. 
     I'm using the data grid filtering with the specific filter type 'Checkbox'. I was wondering if there is a way when opening the filter for a specific column to have the items in the filter unchecked at first? Default behavior is to have them all checked when entering the filter.

Looking forward to your response,
Mihai

3 Replies

RS Renjith Singh Rajendran Syncfusion Team April 24, 2020 12:17 PM UTC

Hi Mihai, 

Thanks for contacting Syncfusion support. 

We have analyzed your requirement and we can achieve this by using Microsoft JSInterop. We have called a JS method in the OnActionComplete event handler using interop. And in that JS method, we have fetched the SelectAll checkbox element and clicked that elements to deselect all the checkboxes in the Filter Checkbox Dialog. 
 
We are also attaching the sample for your convenience, please download the sample from the link below, 
 
Please use the codes below, 

<GridEvents OnActionComplete="OnActionComplete" TValue="Order"></GridEvents> 
 
    public void OnActionComplete(ActionEventArgs<Order> args) 
    { 
        if(args.RequestType.ToString() == "FilterAfterOpen") 
        { 
            JsRuntime.InvokeAsync<object>("DeselectAll"); 
        } 
    } 
 
[DeselectScript.js] 

function DeselectAll() { 
    document.getElementsByClassName("e-chk-hidden")[0].click(); 
} 


Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 



ST steve replied to Renjith Singh Rajendran February 29, 2024 04:24 AM UTC

Hi, I want this default action too.

I am using Blazor version (23.1.44) in my project and it does not work.

I then tried the above sample and it does work.

But, when I upgrade the sample to 23.1.44 it does not work.

Could you please investigate this?



MS Monisha Saravanan Syncfusion Team March 1, 2024 12:10 PM UTC


Hi steve,


We have upgraded the sample to our latest version and it is working fine at our end. Kindly check the below attached sample for your reference and let us know if you face any difficulties or if you have further queries.


Regards,

Monisha



Attachment: BlazorApp10_4(1)_V3_98130bdc.zip

Loader.
Up arrow icon