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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Default Filter Operator Type Change

Thread ID:





127987 Dec 22,2016 08:55 PM UTC Dec 27,2016 09:15 AM UTC ASP.NET MVC 4
Tags: Grid
Asked On December 22, 2016 08:55 PM UTC

I am trying to change the default filter operator of a string type column with no sucsess using the Html helper syncfuison has provided. 
i have the following: 

    @(Html.EJ().DataManager("FlatData").URL(Url.Action("NscDataSource", "Home", null, Request.Url.Scheme)).Adaptor(AdaptorType.UrlAdaptor))
        .ContextMenuSettings(contextMenu =>
        .Columns(c =>
            c.Field(f => f.ID).Width(60).Add();
            c.Field(f => f.GlobalTicket.TicketDisplayID).Width(60).Add();
            c.Field(f => f.Customer).Width(80).Add();
            c.Field(f => f.Contact).Width(150).Add();
            c.Field(f => f.Phone1).Width(120).Add();
            c.Field(f => f.Fax).Width(120).Add();
            c.Field(f => f.Email).Width(150).Add();
            c.Field(f => f.Address).Width(150).Add();
            c.Field(f => f.State).Width(60).Add();
            c.Field(f => f.Zip).Width(60).Add();
            c.Field(f => f.CategorizationLink).Width(50).Add();
            c.Field(f => f.SourceLink).Width(40).Add();
            c.Field(f => f.TraceID).Width(200).Add();
        .FilterSettings(Sett => Sett.FilterBarMode(FilterBarMode.OnEnter)
            .FilteredColumns(col => col.Field("Customer").Operator(FilterOperatorType.Equals).Add()))
        .SortSettings(sort => sort.SortedColumns(col => col.Field("ID").Direction(SortOrder.Ascending).Add()))
        .PageSettings(p => p.PageSize(30).EnableQueryString())
        .ClientSideEvents(e => e

the highligheted lines are what i expect to change the defualt setting but i cannot figure out what i am missing. The grid will still post a dataManager with a where clause that has a startswith predicate. 

Thank You

Jayaprakash Kamaraj [Syncfusion]
Replied On December 23, 2016 09:22 AM UTC

Hi Diamond, 
Thank you for contacting Syncfusion support. 
We have already discussed the same in following knowledge base document. 

Jayaprakash K. 

Replied On December 23, 2016 02:05 PM UTC

Awesome yes i did also find this piece of code. cool.
How do i tie that to an individual column? i do not want to change all of the defaults only one particular column.

Replied On December 23, 2016 05:57 PM UTC

You can use the currentFilteringColumn  property to change the default filter of a particular column instead of changing all of the defaults

    function actionBegin(args) {
        if (args.requestType == "filtering" && args.currentFilteringColumn == "Customer")
            args.currentFilterObject[0].operator = "equal";

Jayaprakash Kamaraj [Syncfusion]
Replied On December 27, 2016 09:15 AM UTC

Hi Diamond,  
We are happy that the problem has been solved. 
Please get back to us if you need any further assistance.   
Jayaprakash K. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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