Declined
Last Updated: 15 May 2024 08:26 by ADMIN
Michal
Created on: 09 May 2024 19:00
Category: Grid
Type: Bug Report
0
grid FilterDescriptor contains +1 additinal wrong filter

 

Hi,

 it seems that grid.GetState() and FilterDescriptors, contains +1 "dummy" object.

- If it is by design, ok, BUT then, how to bind this filter descriptor to the ie TelerikFilter? = It displays that dummy object as it is, and confusing end users. Or how to "identify 100%" that is some kind of dummy value to be trashed?

How to reproduce:

1 run the repl demo

2 put "a" into the first colum(Name) filter

3 click button and observe the content of filter descriptors(serialized below the grid - RED is wrong, Green is expected as ok)

similar, but not the same(iam came from here):

https://feedback.telerik.com/blazor/1606424-manually-setting-the-grid-filters-via-the-grid-state-causes-multiple-composite-filters-on-one-column-where-only-one-filter-descriptor-for-that-member-was-set

 

Thanks for the tip, clarification, or removing that redundant values.

1 comment
ADMIN
Dimo
Posted on: 15 May 2024 08:26

Hi Michal,

The observed behavior is by design. The filter state of every Grid column is stored in a CompositeFilterDescriptor, which has two FilterDescriptors by default.

You can distinguish a dummy FilterDescriptor like this:

  • The Value is null
  • The Operator expects the Valueto not be null, otherwise it won't make sense. For example the Operator is EqualTo, Contains, etc. On the other hand, if the Operator is IsNull, IsNotNull or similar, then the filter descriptor is active even if the Value is null. See the API reference for the FilterOperator enum type.

Regards,
Dimo
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!