Question

I am using this plugin in my asp.net mvc application.

Jquerygrid search function working as expecting. But I want only search with "contains or not". How can I do that?

My search picture is shown below: enter image description here

Was it helpful?

Solution

You need to use the SearchOptions list on the JQGridColumn to specify which filter criteria you want to use for a given column.

If you leave the SearchOptions empty then it will display all the search rules, so you need to write something like this:

private void SetUpSearchDialogGrid(JQGrid grid)
{   
    var column = grid.Columns.Find(c => c.DataField == "Id");
    //...

    column.SearchOptions.Add(SearchOperation.Contains);
    column.SearchOptions.Add(SearchOperation.DoesNotContain);                

    //..
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top