How to add a filter to a column in Grid from code behind?

I have a grid with data populated from MySql database. I want to filter a column for a particular product which will be retrieved from database also. How can I achieve from C# code behind?

FilteredColumn filter = new FilteredColumn();
filter.Field = "Product.Description";
filter.Value = "Wobbler";
filter.Operator = Syncfusion.JavaScript.FilterOperatorType.Equals;
filter.Predicate = "and";
filter.MatchCase = true;

this.Grid.FilterSettings.FilteredColumns.Add(filter);

This is how I tried using a string as value and I can confirm that that string exist in the grid.

1 Reply

TS Thavasianand Sankaranarayanan Syncfusion Team March 19, 2018 11:52 AM UTC

Hi Gangatharan, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we are unable to reproduce the reported issue “Filtering in code behind is not working” from our end. 

We have prepared a sample and it can be downloadable from the below location. 


Please provide the following details for better assistance. 

  1. Share screen shot or video demonstration of the issue.
  2. If you enable allowFiltering property in ejGrid control ?
  3. Share full Grid code example both client and server end.
  4. Share Essential Studio version and browser version details.
  5. If possible share the sample or reproduce the issue in the attached sample.

Regards, 
Thavasianand S. 


Loader.
Up arrow icon