Grid UI does not reflect to changed state

1 Answer 121 Views
Grid
Aleksandr
Top achievements
Rank 1
Bronze
Bronze
Veteran
Aleksandr asked on 28 Aug 2022, 09:42 AM

dojo:

https://blazorrepl.telerik.com/?_ga=2.175076642.1694966489.1661590183-1931469790.1620243254

as you can see on example above, the grid is filtered (during the onInitState event), but user look & feel still unchanged, i mean the filter button is not highlited, if you click on the filter button to expand, the filter item 1 is not selected

1 Answer, 1 is accepted

Sort by
1
Accepted
Dimo
Telerik team
answered on 31 Aug 2022, 10:44 AM

Hello Aleksandr,

The linked REPL is empty. Normally, you need to click the Share button and copy the URL that appears.

I tested the described scenario and it works. You can see an example in the Grid State article. If you are using a FilterMenu, then create a CompositeFilterDescriptor instead of a simple FilterDescriptor:

    @using Telerik.DataSource;

    void OnStateInitHandler(GridStateEventArgs<SampleData> args)
    {
        var fdc = new FilterDescriptorCollection();

        fdc.Add(new FilterDescriptor() { Member = "Id", Operator = FilterOperator.IsLessThan, Value = 5, MemberType = typeof(int) });
        fdc.Add(new FilterDescriptor() { Member = "Id", Operator = FilterOperator.IsEqualTo, Value = null, MemberType = typeof(int) });

        var state = new GridState<SampleData>
        {
            FilterDescriptors = new List<IFilterDescriptor>()
           {
                new CompositeFilterDescriptor()
                {
                     LogicalOperator = FilterCompositionLogicalOperator.And,
                     FilterDescriptors = fdc
                }
            }
        };

        args.GridState = state;
    }

Regards,
Dimo
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.

Aleksandr
Top achievements
Rank 1
Bronze
Bronze
Veteran
commented on 31 Aug 2022, 11:09 AM

excellent, thx for help, works as expected 
Tags
Grid
Asked by
Aleksandr
Top achievements
Rank 1
Bronze
Bronze
Veteran
Answers by
Dimo
Telerik team
Share this question
or