Radzen Data Grid Settings Issue with FilterMode.CheckBoxList

Hello,

Im currently trying to Save my DataGrid Settings, as in your Sample Blazor DataGrid Component - Save / Load Settings | Free UI Components by Radzen
The Only modification I made is seting the FilterMode to FilterMode.CheckBoxList.

After Setting the Contry Filter I´m getting following error

The Error should be the FilterValue:
Radzen.DataGridColumnSettings.FilterValue = {System.Collections.Generic.HashSet`1[System.Object].Cast().Cast()}

After JsonSerializer.Deserialize :
Radzen.DataGridColumnSettings.FilterValue =
ValueKind = Array : "["XXX","XYX"]"

Do you have any suggestions how to Convert it back to the HashSet?

Make sure you don't have saved settings from other filtering type since in this case the value will not match what's expected by the DataGrid:

Also this demo is using IQueryable while such filter type (CheckBoxList) cannot be translated to SQL and works in-memory only - you should call ToList() to your query before assigning to DataGrid Data.

Hello,
thanks for your reply.
I have the above mentioned Issue with a dynamic DataGrid as Blazor DataGrid Component - Dynamic Data | Free UI Components by Radzen

I have done some more research and found that you Convert the filterProperty to an IEnumrable if no Type is given.

Is it possible to do so with the transfered Type mentioned below (>)?

Or do you have some other suggestions to make it work with a dynamic DataGrid?

 protected override void OnInitialized()
        {
            if (Grid != null)
            {
                Grid.AddColumn(this);

                var canSetFilterPropertyType = (FilterMode ?? Grid.FilterMode) == Radzen.FilterMode.CheckBoxList && FilterTemplate == null;

                if (canSetFilterPropertyType)
                {
                    if (Type == null)
                    {
                        var fp = GetFilterProperty();
                        var pt = !string.IsNullOrEmpty(fp) ?
                                PropertyAccess.GetPropertyType(typeof(TItem), fp) : typeof(object);

                        _filterPropertyType = typeof(IEnumerable<>).MakeGenericType(pt);
                    }
> else
> {
> filterPropertyType = typeof(IEnumerable<>).MakeGenericType(Type);
> }

                    if (GetFilterOperator() == FilterOperator.Equals)
                    {
                        SetFilterOperator(FilterOperator.Contains);
                    }

                    Grid.FilterPopupRenderMode = PopupRenderMode.OnDemand;
                }

I’m afraid that I don’t have other suggestions except to clear the settings if filter type is changed.

Sorry I think i didn´t catch that right.
filter type = FilterMode?

The type of the filter schould be the type of the column in my dynamic DataGrid.

Maby you colud provide me with a Sample where FilterMode.CheckBoxList is set ,the data of the DataGrid is dynamic as in your sample(link above) and i can save the settings including the filtered values

Saved settings are per FilterMode since in case of CheckBoxList filtering the value is a collection while in other cases is single value. I've nothing else to add.