Closed Zapolatero closed 1 year ago
I also found that, when applying a not equals filter on a text column, items who have a null string as a value for the filtered column wont be taken in account and wont be displayed. Even if their value is different to the filter's value, as they are null.
Describe the bug When applying the filter "isNull" on a nullable text column, no item is returned. This issue happens even if, when no filter is applied on this column, items with a null value on this column are displayed.
To Reproduce This behavior can be reproduced on the autogenerated page on the gridBlazor demo. Steps to reproduce the behavior:
Expected behavior When the grid displays data with a null value on a text column, we expect to see data when applying an "is Null" filter on this column. But the grid is empty when applying such a filter.
Screenshots Items with null values for the "ship name" column are displayed on the grid
When applying an "is null" filter on the same column, no items are shown :
Additional context This issue originates in the way filters are managed in the DefaultColumnFilter.cs class. When applying an "is null" filter on a text column, the sql generated by the Entity Framework to filter data will be as follows :
This filter only returns items whose value for the filtered column is an empty, not null string. This is a problem as we would also like to fecth items with a null string.
In order to return data with a null string and data with an empty string for the filtered column, the where clause should be as follows :
Bug fix I forked this repository and am currently trying to fix the issue. I will issue a pull request as soon as I find a fix.