FilterMode CheckBoxList doesn't handle null properly

When there's a null entry in the checkboxlist filter, it shows blank, but selecting it doesn't show any entries.
image

After applying, No records:
image

I'd expect to see everyone who has a null Employee1.

This is probably something that could be handled in my/consumer's models, but I feel like there should be a difference between empty strings, "", and nulls, so that they could be filtered separately. A null could be there's no Boss, and an empty string could mean Boss doesn't have a Title.

Using the Radzen.WebAssembly.sln,
RadzenBlazorDemos\Pages\DataGridCheckBoxListFilter.razor

I added this Include at the bottom to make sure data loaded,

.Include("Employee.Employee1")

I added this column after the Employee column.

        <RadzenDataGridColumn Property="Employee.Employee1.LastName" Title="Reports To">
            <Template Context="order">
                <RadzenImage Path="@order.Employee?.Employee1?.Photo" Style="width: 32px; height: 32px;" class="rz-border-radius-4 rz-me-2" AlternateText="@(order.Employee.Employee1?.FirstName + " " + order.Employee.Employee1?.LastName)" />
                @order.Employee.Employee1?.FirstName @order.Employee.Employee1?.LastName
            </Template>
        </RadzenDataGridColumn>

Also, to make the demo data model easier to understand, on the Employee class:
image

ReportsTo should be renamed to ReportsToID
Employee1 should be renamed to ReportsTo
Employees1 should be renamed to Employees or Staff/Subordinates.

The checkboxlist popup could use a max-width too:

Discontinued column in our demo works normally with null:

Doesn't work on the Customer column though. I think the difference is the property Customer.CompanyName vs ProductDiscontinued

Thanks! The issue was caused since the CheckBoxList filter will attempt to filter on empty string instead of null - will be fixed in our next update later the week.

1 Like