This is a migrated thread and some comments may be shown as answers.
Grid filter not working with dynamic columns and SignalR
1 Answer 7 Views
This is a migrated thread and some comments may be shown as answers.
iCognition
Top achievements
Rank 1
iCognition asked on 26 Mar 2021, 05:22 AM

I have a grid which looks like this:

@(Html.Kendo().Grid()
    .Columns(columns =>
    {
        foreach (var fieldId in listOfFieldIds)
        {
            columns.Bound(o => o.DictionaryOfFieldIdsToValues[id].Value);
        }
    }
    .DataSource(dataSource =>
    {
        dataSource.SignalR()
            .Filter(filter =>
            {
                filter.Add(o => o.DictionaryOfFieldIdsToValues["MyId123"].Value).Contains("hello world");
            });
        })
    });

 

Programmatically setting the filter is not working as expected:

1) the column which corresponds to MyId123 does not get the filter in its header menu

2) on inspecting the filter in parameterMap, the filter has been applied as a filter collection, like so

{logic: "and", filters: Array(1)}
    filters: Array(1)
    0:
        filters: Array(1)
        0: {field: "DictionaryOfFieldIdsToValues["MyId123"].Value", operator: "contains", value: "hello world"}
        length: 1
    logic: "and"
    length: 1

When a user filters the column themselves it works as expected (parameterMap shows this)

{logic: "and", filters: Array(1)}
    0: {field: "DictionaryOfFieldIdsToValues["MyId123"].Value", operator: "contains", value: "hello world"}
    length: 1
    logic: "and"

 

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 30 Mar 2021, 12:51 PM

Hello,

I have noticed that the current thread is a duplicate of a private support ticket in which is under active investigation. Whenever a conclusion is reached on what exactly causes the filter menu to misbehave, I will update this thread.

 

Kind regards,
Tsvetomir
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
iCognition
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or