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
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to change the dataSource for the checkbox list in excel filtering

Platform: jQuery |
Control: ejGrid
Tags: filtering, ejgrid



You can change the datasource/query for the checkbox list in excel filter using ActionBegin event of Grid. The following code example shows how to change the datasource in excel Filtering of Grid.

  1. Render the Grid control.




 2. You can change the dataSource/query in the actionBegin event. In the below we have modified the excel filter query by adding a take query. Here checkbox list datasource show depends upon take query value.



Figure 1: Excel filter with query modified.



You must log in to leave a comment
Hugo Arevalo
Sep 06, 2017

Is it possible to change the datasource for the checkboxlist??

Saravanan Arunachalam [Syncfusion]
Sep 07, 2017

Hi Hugo,

Thanks for contacting Syncfusion’s support.

In this knowledge base document, we have queried the dataSource and based on it we have rendered the checkbox list.

And we can achieved your requirement by changing the dataSource in the filterModel which you can get from the actionBegin event with requesType “filterchoicerequest”.  Please refer to the below code example.

        $(function () {


                . . .

                actionBegin: "begin"



        function begin(args) {

            //In here we have assigned the empty data to the ShipCountry field       

            if(args.requestType == "filterchoicerequest" && args.filterModel.fName == "ShipCountry")

                args.filterModel._dataSource = [];





For your convenience we have created a simple sample in the jsplayground.



Saravanan A.

Hugo Arevalo
Sep 21, 2017

I tried your sample and I can succesfully change the datasource for only one filter, however when applying the filter the options are gone and I'm unable to load them again.


Hugo A.

Venkatesh Ayothi Raman [Syncfusion]
Sep 23, 2017

Hi Hugo,


Thanks for the update,


We have changed data source based on field name while clicking the filter icon and we were unable to reproduced the reported issue at our end as well as we have prepared a sample for your convenience which can be  referred from following link,

Sample: http://jsplayground.syncfusion.com/iz0fhgzd


In this sample, we have changed the excel filter data source for ShipCountry column in actionBegin event. If you still face the same issue, then could you please provide following information,

1)      Share the code example of action begin event.

2)      Scenario for replication procedure.

3)      You have mentioned about filter options. Please share the more details of it.

4)      A sample if possible or modified the given sample as issue reproducible.




Venkatesh Ayothiraman.

Hugo Arevalo
Sep 25, 2017

When I apply another filter the information gets lost. I put this on the begin event:

if(args.requestType == "filterchoicerequest" && args.filterModel.fName == "ShipCountry") {

              var countryDataSource = [{ShipCountry : "Germany"}, {ShipCountry : "Brazil"}];

                 args.filterModel._dataSource = countryDataSource;


Is there any way for it to work?


Venkatesh Ayothi Raman [Syncfusion]
Sep 26, 2017

Hi Hugo, 


Thanks for the update.


By default, the excel filter render the checkbox list items based on the records in the Grid’s dataSource initially and the checkbox list item will render based on the filtered data after applying the filtering for any one of the column which is default behavior and it is behave similar to the filtering in Microsoft excel. So, overriding the above mentioned behavior is not feasible. 



Venkatesh Ayothiraman.

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile