Cannot perform grid filtering since version 19.4 anymore

Hey guys, 

since we updated to Syncfusion version 19.4.42 we cannot peform filtering in our grids due to a change you did in the Syncfusion.Blazor.DataOperations.cs file.

You changed 

public static IQueryable<T> PerformFiltering<T>(
IQueryable<T> dataSource,
List<WhereFilter> whereFilter,
string condition)
{
return QueryableOperation.PerformFiltering<T>(dataSource, whereFilter, condition);
}

to

public static IQueryable<T> PerformFiltering<T>(
IQueryable<T> dataSource,
List<WhereFilter> whereFilter,
string condition)
{
return QueryableOperation.PerformFiltering<T>(Queryable.OfType<T>(dataSource), whereFilter, condition);
}

The Queryable.OfType<T> throws an exception to most of our DTOs. The exception looks like this:
System.NotSupportedException: 'UserReportingDto' is not a valid metadata type for type filtering operations. Type filtering is only valid on entity types and complex types. 

Since this was possible before I want to ask you what do we have to change or look for? Or is it a known issue on your side? Is this intended for some query improvements or what's the reason for this?

Best regards



11 Replies

SB Sven Boris Bornemann January 19, 2022 08:09 AM UTC

Hi, 

as additional information: We use AutoMapper to map the Database model into the DTO.

dataSource = Mapper.ProjectTo<TTarget>(SourceData, QueryParamsForAutomapper);

Best regards


MS Monisha Saravanan Syncfusion Team January 19, 2022 09:47 AM UTC

Hi Patrick, 

Thanks for contacting Syncfusion support. 

We are currently checking the reported case at our end and we will update the further details within two business days(on or before January 21, 2022). Until then we appreciate your patience. 

Regards, 
Monisha 



MS Monisha Saravanan Syncfusion Team January 21, 2022 11:21 AM UTC

Hi Patrick, 

Thanks for the patience. 

We are unable to reproduce the reported issue at our end. We need some more details about the requirement. So kindly share the following details to validate the reported query further at our end. 

  1. Share us the complete grid code with your model class and datasource.

  1. Share us the way you bind the datasource to the grid.

  1. Share us the FilterType you are using.

  1. Kindly share us the simple issue reproducing sample or reproduce the issue in the below provided sample.
 
 
The above requested details will be helpful for us to validate your query and to provide you with a better solution as early as possible. 

Regards, 
Monisha 



UN Unknown January 24, 2022 03:45 PM UTC

Hello Monisha! Thanks for your reply.

We tried to reproduce the case in a separate project but weren't able to because we need a database connection and our project is too big to share - but we have more informations that might help! 

One important information was missing: 

We are using the EntityFramework. I'll share you an example of a data base entity (UserReporting.cs) and a dto (UserReportingDto.cs). The SfGrid is of type UserReportingDto. We don't cache the entries and filter directly on the database and this is where the issue appears. You can see this in the full stack trace - also to find in the attachment (stacktrace.txt) -> the operation tries to translate the sql expression on the db and this is not possible. 


We are also using a custom data adaptor in the grid - also shared in the attachment (HQDataComponentAdaptor.cs). The current implementation of DataOperations.PerformFiltering is used currently at at line 234 of HQDataComponentAdaptor:

public static IQueryable<T> PerformFiltering<T>(
IQueryable<T> dataSource,
List<WhereFilter> whereFilter,
string condition)
{
return QueryableOperation.PerformFiltering<T>(Queryable.OfType<T>(dataSource), whereFilter, condition);
}



We found a workaround for now - if we use this implementation:

public static IEnumerable<T> PerformFiltering<T>(
IEnumerable<T> dataSource,
List<WhereFilter> whereFilter,
string condition)
{
return (IEnumerable<T>) QueryableOperation.PerformFiltering<T>(dataSource.AsQueryable<T>(), whereFilter, condition);
}

To use this, we have to cast our data source to an IEnumerable and Cast the result of this call back to an IQueryable. It works but doesn't feel good and might impact the performance. 


This behaviour just appears if the filter operation is directly running in the database. We also have grids with cached data and there everything is fine.  


Hope this helps to find our issue, the basic you need to reproduce is a database connection and the grid filtering on the database. 


Best regards and thanks for the investigation already! 

Patrick


Attachment: DataBaseFilteringIssue_69320c00.zip


MS Monisha Saravanan Syncfusion Team January 25, 2022 01:09 PM UTC

Hi Patrick, 

Thanks for your update. 

currently we are validating the reported query at our end and we are preparing sample based on your requirement. We need some more time to analyze your query. So we will update you the further details in three business days on or before (31st January 2021).  

Until then we appreciate your patience and we  suggest you to use the mentioned workaround. 
 
Regards, 
Monisha 



MS Monisha Saravanan Syncfusion Team January 31, 2022 01:49 PM UTC

Hi Patrick, 

Thanks for your patience. 
  
We have confirmed this as bug and we will share further details regarding bug within tomorrow (01.02.2022) . Also we have created an ticket under your account. Kindly follow the ticket for additional information.  
 
Regards, 
Monisha  



MS Monisha Saravanan Syncfusion Team February 1, 2022 12:22 PM UTC

Hi Patrick, 

Greetings from Syncfusion support. 

We have validated and considered your query as a bug and logged the defect report “Grid filtering does not work since version 19.4.42” for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle) and will include the fix in our upcoming patch release which is expected to be rolled out on February 9th , 2022. Until then we appreciate your patience.  
  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.   


Regards 
Monisha 



UN Unknown February 1, 2022 02:13 PM UTC

Thank you very much! 


I'm looking forward for the update. 


Thanks for your work guys, best regards



MS Monisha Saravanan Syncfusion Team February 2, 2022 09:24 AM UTC

  
Hi Patrick, 

Thanks for the update. 

We will update you once the release is rolled out. Until then we appreciate your patience. 

Regards, 
Monisha 



MS Monisha Saravanan Syncfusion Team February 10, 2022 04:29 AM UTC

Hi Patrick, 

Sorry for the inconvenience caused. 

Due to some unforeseen circumstances, we could not able to include the fix for this issue “Grid filtering does not work since version 19.4.42” in our mentioned weekly release. But we will fix this issue and this will be included in our upcoming bi-weekly release which is expected to be rolled out on February 16th , 2022. Until then we appreciate your patience. 

You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.     
       

We will update you once the issue was fixed. Until then we appreciate your patience.       

Regards,       
Monisha


VN Vignesh Natarajan Syncfusion Team February 17, 2022 12:37 PM UTC

Hi Patrick, 
 
We are glad to announce that, we have included fix for the “Grid filtering does not work since version 19.4.42 in our release(19.4.0.52).  So please upgrade to our latest version of Syncfusion NuGet package to resolve the reported issue. Please find the Nuget package for latest fixes and features from below. 
 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.  
    
Regards,             
Vignesh Natarajan 


Loader.
Up arrow icon