DataGrid "Translation of method 'string.ToLowerInvariant' failed. Exception" on Version 6.0.0up with EF Core DBSet #1608

Closed
opened 2026-01-29 17:56:05 +00:00 by claunia · 1 comment
Owner

Originally created by @Chromwell on GitHub (Feb 13, 2025).

Describe the bug
Radzen DataGrid Bug with
FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
causes Exception when a string is entered in
FilterMode="FilterMode.Simple"
Filter box on a string property
Data is bound from EF CORE .NET9 DbSet .AsQueryable() from Oracle 19 Database
All related packages updated to .NET9

Exception:
.Where(b => (b.Component.ToLowerInvariant() ?? null).Contains("a"))' could not be translated. Additional information: Translation of method 'string.ToLowerInvariant' failed.

Failure started appearing with Version Radzen 6.0.0 / Also present in 6.0.1
Working without exception and any code change on Radzen 5.9.9

To Reproduce
Steps to reproduce the behavior:
enter a lowercase letter in FilterMode.Simple box on DataGrid

Expected behavior
filtering the table correctly without exception

Desktop:

  • OS: Windows 11
  • Browser: Chrome/Edge latest Version

Additional context
maybe related to change in
Radzen.Blazor/QueryableExtension.cs
678d861e22

The working query from Radzen 5.9.9 looks very different to the failing one but works when i entered "a2":
SELECT "b"."Id", "b"."BerichtTyp", "b"."Closed", "b"."Component", "b"."ComponentText", "b"."Created", "b"."Deleted", "b"."Department", "b"."Fehlerursache_grob", "b"."FocusFactory", "b"."LessonsLearned", "b"."Nummer", "b"."Part", "b"."PartText", "b"."Priority", "b"."Problem", "b"."ProductionLine", "b"."QLF", "b"."Status", "b"."Supplier", "b"."Title", TRUNC("b"."Created") "c"
FROM "PST"."Berichte" "b"
WHERE (((((((
SELECT "t"."UID"
FROM "PST"."Teams" "t"
INNER JOIN "PST"."TeamTypes" "t0" ON "t"."TypeId" = "t0"."Id"
WHERE (("b"."Id" = "t"."BerichtId") AND ("t0"."Bezeichnung" = N'Autor'))
FETCH FIRST 1 ROWS ONLY) = :AuthService_User_UID_0) OR ("b"."Nummer" IN (8240004, 8240001)))) AND (NOT ("b"."Deleted" <> 0 )))) AND (LOWER(CASE
WHEN "b"."Component" IS NULL THEN NULL
ELSE "b"."Component"
END) LIKE N'%a2%'))
ORDER BY TRUNC("b"."Created") DESC
OFFSET :p_2 ROWS FETCH NEXT :p_3 ROWS ONLY
) "b0"

Originally created by @Chromwell on GitHub (Feb 13, 2025). **Describe the bug** Radzen DataGrid Bug with FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" causes Exception when a string is entered in FilterMode="FilterMode.Simple" Filter box on a string property Data is bound from EF CORE .NET9 DbSet .AsQueryable() from Oracle 19 Database All related packages updated to .NET9 Exception: .Where(b => (b.Component.ToLowerInvariant() ?? null).Contains("a"))' could not be translated. Additional information: Translation of method 'string.ToLowerInvariant' failed. Failure started appearing with Version Radzen 6.0.0 / Also present in 6.0.1 Working without exception and any code change on Radzen 5.9.9 **To Reproduce** Steps to reproduce the behavior: enter a lowercase letter in FilterMode.Simple box on DataGrid **Expected behavior** filtering the table correctly without exception **Desktop:** - OS: Windows 11 - Browser: Chrome/Edge latest Version **Additional context** maybe related to change in Radzen.Blazor/QueryableExtension.cs https://github.com/radzenhq/radzen-blazor/commit/678d861e223db909f25b280f152ccf1f168df9b0 The working query from Radzen 5.9.9 looks very different to the failing one but works when i entered "a2": SELECT "b"."Id", "b"."BerichtTyp", "b"."Closed", "b"."Component", "b"."ComponentText", "b"."Created", "b"."Deleted", "b"."Department", "b"."Fehlerursache_grob", "b"."FocusFactory", "b"."LessonsLearned", "b"."Nummer", "b"."Part", "b"."PartText", "b"."Priority", "b"."Problem", "b"."ProductionLine", "b"."QLF", "b"."Status", "b"."Supplier", "b"."Title", TRUNC("b"."Created") "c" FROM "PST"."Berichte" "b" WHERE ((((((( SELECT "t"."UID" FROM "PST"."Teams" "t" INNER JOIN "PST"."TeamTypes" "t0" ON "t"."TypeId" = "t0"."Id" WHERE (("b"."Id" = "t"."BerichtId") AND ("t0"."Bezeichnung" = N'Autor')) FETCH FIRST 1 ROWS ONLY) = :AuthService_User_UID_0) OR ("b"."Nummer" IN (8240004, 8240001)))) AND (NOT ("b"."Deleted" <> 0 )))) AND (LOWER(CASE WHEN "b"."Component" IS NULL THEN NULL ELSE "b"."Component" END) LIKE N'%a2%')) ORDER BY TRUNC("b"."Created") DESC OFFSET :p_2 ROWS FETCH NEXT :p_3 ROWS ONLY ) "b0"
Author
Owner

@Chromwell commented on GitHub (Feb 14, 2025):

6.0.2 can now filter without exception. Thanks for the very fast fix!

@Chromwell commented on GitHub (Feb 14, 2025): 6.0.2 can now filter without exception. Thanks for the very fast fix!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1608