Error filtering data with more than one filter and different operators

Hi.

We have a problem when filtering a grid, with more than one operator (as you can see in the image)


-----------Code------------
public async Task<IActionResult> SyncFusionDbSet_Read<T>(DataManagerRequest dm) where T : class
        {
            var type = typeof(T);
            var DataSource = await _repository.FindAll<T>();            
            DataOperations operation = new DataOperations();
            if (dm.Search != null && dm.Search.Count > 0)
            {
                DataSource = operation.PerformSearching(DataSource, dm.Search);  //Search
            }
            int count = 0;
            if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting
            {
                DataSource = operation.PerformSorting(DataSource, dm.Sorted);
            }
            if (dm.Where != null && dm.Where.Count > 0) //Filtering
            {
                DataSource = operation.PerformFiltering(DataSource, dm.Where, dm.Where[0].Operator);
                count = DataSource.Cast<T>().Count();
            }
            else
            {
                count = DataSource.Cast<T>().Count();
            }
            if (dm.Skip != 0)
            {
                DataSource = operation.PerformSkip(DataSource, dm.Skip);   //Paging
            }
            if (dm.Take != 0)
            {
                DataSource = operation.PerformTake(DataSource, dm.Take);
            }

            return dm.RequiresCounts ? Json(new { result = DataSource, count = count }) : Json(DataSource);
        }


Can u help us with this?



1 Reply 1 reply marked as answer

PG Praveenkumar Gajendiran Syncfusion Team May 5, 2021 12:37 PM UTC

Hi Javier, 
Greeting from Syncfusion support.

Before proceeding with your query we would like to inform you that by default in Ej2 Grid, we suppose to choose only one operator at the filtering. We have prepared a Grid sample with filtering feature for your reference. Please find it below, 
  
Sample:   https://www.syncfusion.com/downloads/support/forum/165150/ze/GRIDUR~1372754678.zip

We need the following details to understand the query better at our end. So kindly share the following details.  

  1. Syncfusion package version used.
  2. Complete grid rendering code.
  3. Let us know the replication procedure for reproducing the problem with Video demonstration to understand it better.
  4. If possible share us a simple sample to replicate the problem or try reproducing it in the above provided sample.
  5. Please elaborate on your reported issue.

Please get back to us with the requested details which will be helpful for us to validate the reported scenario at our end and provide the solution as early as possible 

Regards 
Praveenkumar G 


Marked as answer
Loader.
Up arrow icon