Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RadzenDataGrid Filter and Sort don't work with ComplexType #1370

Closed
Andrey-2021 opened this issue Feb 12, 2024 · 2 comments
Closed

RadzenDataGrid Filter and Sort don't work with ComplexType #1370

Andrey-2021 opened this issue Feb 12, 2024 · 2 comments

Comments

@Andrey-2021
Copy link

Blazor project: https://github.com/Andrey-2021/RadzenDataGrid

Describe the bug
In RadzenDataGrid dont't work sort and filter with [ComplexType]

first class:
`public class PriceListService
{
[Key]
public int Id { get; set; }

[Required]
public PriceListServiceBase ServiceBase { get; set; } = new();

}
second class:
[ComplexType]
public class PriceListServiceBase
{
public int Index { get; set; }
public string? Code { get; set; }
public string? ServiceName { get; set; }
}
`

**RadzenDataGrid **
image

image

We have
Exception: Comparing complex types to null is not supported.

image

To Reproduce
Steps to reproduce the behavior:

  1. Load project https://github.com/Andrey-2021/RadzenDataGrid
  2. Config db connection string 'DefaultConnection' in appsettings.json
  3. Run project
  4. Click button 'First step -> Add Data to Db'
  5. try sort column Index or Code or Name in RadzenDataGrid
    we get an error: Exception: Comparing complex types to null is not supported.

Screenshots
image

@enchev
Copy link
Collaborator

enchev commented Feb 13, 2024

Since you are using LoadData the sorting is at your premises in the event handler:
image
If the EF cannot translate such sort expression to SQL you can use ToList() for your data to sort in-memory.

@enchev enchev closed this as completed Feb 13, 2024
@Andrey-2021

This comment was marked as abuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants