Completed
Last Updated: 29 Apr 2025 12:48 by ADMIN

Hello,

I created a repl to replicate the issue that I'm having. I created a Filter with a custom editor. For this example, I used a Textbox and I save the changes back to the context.FilterDescriptor.Value in the OnChange method which occurs when the user blurs focus.

If you start the repl w/o checking the Use Custom Editor checkbox and enter text where the "Sample" value is located you will see the changes are saved properly to the bound CompositeFilter property and are echo'd back in the screen.

If instead you check the Use Custom Editor box and perform the same test you'll see that the same changes are not present in the bound CompositeFilter. 

Note that this issue only occurs if you start with an existing CompositeFilter and bind it to the filter control. It seems that if the control creates the FilterDescriptor objects then their changes bind properly, but if the FilterDescriptor objects existed before binding to the control then the issue occurs.

https://blazorrepl.telerik.com/wIOtcKOb31mjTc3351

Thank You,

-Andy

============= TELERIK EDIT ===============

A possible workaround is to find the original filter descriptor and update its Value:

@using Telerik.DataSource

@System.Text.Json.JsonSerializer.Serialize(FilterValue)

<br />
<br />

<TelerikFilter @bind-Value="@FilterValue">
    <FilterFields>
        <FilterField Name="Field" Type="@(typeof(string))">
            <ValueTemplate>
                <TelerikTextBox Value="@((string)context.FilterDescriptor.Value)"
                                ValueChanged="@( (string newValue) => OnTextBoxValueChanged(context.FilterDescriptor, newValue) )"
                                DebounceDelay="0" />
            </ValueTemplate>
        </FilterField>
    </FilterFields>
</TelerikFilter>

@code {
    private void OnTextBoxValueChanged(FilterDescriptor templateFD, string newValue)
    {
        var originalFD = FilterValue.FilterDescriptors.OfType<FilterDescriptor>().FirstOrDefault(x =>
        {
            return x.Member == templateFD.Member &&
                x.MemberType == templateFD.MemberType &&
                x.Operator == templateFD.Operator &&
                x.Value == templateFD.Value;
        });

        if (originalFD != null)
        {
            templateFD.Value = newValue;
            originalFD.Value = newValue;
        }
    }

    private CompositeFilterDescriptor FilterValue { get; set; } = new()
    {
        LogicalOperator = FilterCompositionLogicalOperator.Or,
        FilterDescriptors = new FilterDescriptorCollection() {
             new FilterDescriptor()
            {
                Member = "Field",
                MemberType = typeof(string),
                Value = "Sample"
            }
         }
    };
}

 

Completed
Last Updated: 12 Jul 2024 07:36 by ADMIN
Release 2024 Q2 (May)
Created by: Jerome
Comments: 8
Category: Filter
Type: Feature Request
35
Is there a way to create a custom template for the FilterField? I would like to create autocomplete/comboboxes for some of the options.
Completed
Last Updated: 19 Mar 2024 15:06 by ADMIN
Release 2024 Q2 (May)
Created by: Jesper
Comments: 0
Category: Filter
Type: Feature Request
6

Please expose a refresh/rebind method for the Filter. I want to force refresh the component when programmatically changing its value during runtime.

===

ADMIN EDIT

===

A possible workaround for the time being is to dispose the component and reinitialize it again after programmatically changing the value. Here is an example: https://blazorrepl.telerik.com/GnkgQPPU37sHWkak55.

Completed
Last Updated: 20 Feb 2024 13:01 by ADMIN
Release 4.2.0 (04/26/2023)

When I change the field from the dropdown to another field of the same type, the filter editor is not updated.

The issue occurs when I'm using Enum fields - the dropdown editor is not updated to display the correct values of the newly selected Enum field.

Reproduction: https://blazorrepl.telerik.com/QHExPalR55jvaD1t12.

Steps to reproduce:

  1. Select NumberField
  2. The dropdown editor still shows the Color values

 

Completed
Last Updated: 06 Dec 2022 09:38 by ADMIN
Release 4.0.0 (18 Jan 2023) (R1 2023)

Steps to reproduce:

  1. Run this REPL snippet
  2. Click on the Add Expression button
  3. Try to delete the newly added expression.
Completed
Last Updated: 16 May 2022 22:05 by ADMIN
Created by: Dale
Comments: 2
Category: Filter
Type: Bug Report
1

If the CompositeFilterDescriptor is set with a predefined filter before the filter component is rendered on the page it locks up the UI.

 

I've noticed this issue if the Filter is user under a TabStrip.. You set the filter and navigate way from the tab and back it will lock up.

Completed
Last Updated: 30 Mar 2022 11:17 by ADMIN
Release 3.2.0
When the Filter is hosted in a Window, and there is a filter expression, closing the window and trying to reopen it again end in an infinite loop