Filtering Error after adding new data

I am receiving an error after adding new data.
My SfDataGrid is bound to EF core database via CollectionViewSource. In my application I have input area where user enters data and when completed presses button to add data to database context. It all work data is being added and it shows up in DataGrid as new line.
I also have a checkbox to set filter for one of the columns in the datagrid. When application loads and data is displayed from database it behaves correctly.
However, when I add new data  and check the checkbox it shows me an error: "System.ArgumentException: 'Object of type 'FilteringExample.User' cannot be converted to type 'Castle.Proxies.UserProxy'.'
I have replicated part of application and attached an example.
When you run the example make sure ConnectionString is valid for your VS loacaldb. Database will be seeded with example data.
When run inspect the behaviour of the check box. Add some data and try the checkbox again.

Attachment: FilteringExample_8185f685.zip

5 Replies

MA Mohanram Anbukkarasu Syncfusion Team March 5, 2021 02:00 PM UTC

Hi Mariusz, 

Thanks for using Syncfusion products.   

We are currently validating this. We will check and update with further details on March 9, 2021. We appreciate your patience until then.   

Regards,  
Mohanram A. 



MA Mohanram Anbukkarasu Syncfusion Team March 9, 2021 02:07 PM UTC

Hi Mariusz, 

We regret for the inconvenience.  

We are still validating this. We will check and update with further details on March 11, 2021. We appreciate your patience and understanding.   

Regards,   
Mohanram A. 



MA Mohanram Anbukkarasu Syncfusion Team March 11, 2021 01:38 PM UTC

Hi Mariusz Juszkiewicz, 

We regret for the inconvenience.  

We have checked the provided sample and we are able to reproduce the issue in our end. We are unable to found the cause for the reported issue. We are still validating this. We need two more business days to properly validate this issue. We will check and update with further details on March 16, 2021. We appreciate your patience and understanding.  

Regards, 
Mohanram A. 



MJ Mariusz Juszkiewicz March 11, 2021 05:30 PM UTC

Mohanram,

I think I found the cause for the error it is the lazy loading EF feature I have enabled.
When I remove lazy loading it works fine. Remove UseLazyLoadingProxies() in ApplicationDBContext.




MA Mohanram Anbukkarasu Syncfusion Team March 12, 2021 05:00 AM UTC

Hi Mariusz Juszkiewicz, 

Thanks for the update.  

We are glad to know that the reported problem has been resolved at your end.  

Regards, 
Mohanram A. 


Loader.
Up arrow icon