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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change the default comparison operator of the filter bar.

In our current implementation of the grid filter bar’s default operator for string column is “startswith” and for the numeric column is “equal”.

We can change the default operator of the filter bar to other operators like contains, lessthan and etc. using actionBegin client side event of the grid as follows.

Example:

JS:

 

 MVC:

 

ASP:

 

Changing the operator:

 

Result:

                                                        Figure: Filterbar with contains operator

Article ID: Published Date: Last Revised Date: Platform: Control:
3369 01/23/2015 08/06/2015 JavaScript ejGrid
Did you find this information helpful?
Comments
Diamond Dec 23, 2016
use args.currentFilteringColumn if you want to change the default for only a particular column instead of changing the defalut for all coulumns with the default operator of "startsWIth"    

function actionBegin(args) {
        if (args.requestType == "filtering" && args.currentFilteringColumn == "Customer")
        {
            args.currentFilterObject[0].operator = "equal";
        } 
Reply
Add Comment
You must log in to leave a comment

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