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

Setting FilterMenu Search Type

I have a grid that I'm using the FilterBar FilterType. The problem is that for string columns it forces a search of "Starts with" which is very useless for us. Is there a way to manually override this and use "Contains" or other search criteria?

My control code:
@(Html.EJ().Grid<Resource>("resourceGrid")
        .Datasource((IEnumerable<object>)ViewBag.datasource)
        .AllowSorting()
        .AllowPaging()
        .AllowFiltering()
        .FilterSettings(filter => { filter.FilterType(FilterType.FilterBar);
        })
        .AllowResizing()
        .AllowResizeToFit()
        .AllowSelection(false)
        .EnableRowHover()
        .ClientSideEvents(eve => { eve.RecordClick("gotoResource"); })
        .Columns(col =>
        {
            col.Field("Id").HeaderText("Id").TextAlign(TextAlign.Left).Width(40).Add();
            col.Field("ResourceTypeName").HeaderText("Resource Type").TextAlign(TextAlign.Left).Width(80).Add();
            col.Field("ProductName").HeaderText("Product").TextAlign(TextAlign.Left).Width(75).Add();
            col.Field("Name").HeaderText("Name").TextAlign(TextAlign.Left).Width(75).Add();
            col.Field("Description").HeaderText("Description").TextAlign(TextAlign.Left).Width(80).Add();
            col.Field("Url").HeaderText("Url").TextAlign(TextAlign.Left).Width(80).Add();
        }))


Previously we were using the Menu Filter which allows you to choose the search filter from a menu, but this was painful as it would always default to an option that we never want to use.

Help please! 

1 Reply

JK Jayaprakash Kamaraj Syncfusion Team April 24, 2017 07:19 AM UTC

Hi Marc, 

Thank you for contacting Syncfusion support. 

We have already discussed same in the following knowledgebase document. 


Regards, 

Jayaprakash K. 


Loader.
Up arrow icon