[RadzenDropDown] Filtering stop working once custom template set #977

Closed
opened 2026-01-29 17:47:13 +00:00 by claunia · 1 comment
Owner

Originally created by @enricobenedos on GitHub (Sep 6, 2023).

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
Working filtering:

<RadzenDropDown Placeholder="Ticker" Data="@_tickerInfos" @bind-Value="@_selectedTickerInfo"
                ValueProperty="Name" TextProperty="Name"
                AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive">
</RadzenDropDown>

Broken filtering with custom template

<RadzenDropDown Placeholder="Ticker" Data="@_tickerInfos" @bind-Value="@_selectedTickerInfo"
                ValueProperty="Name" 
                AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive">
    <Template>
        @($"{(context as TickerInfo)!.Name} - {(context as TickerInfo)!.Description}")
    </Template>
</RadzenDropDown>
public class TickerInfo
{
    public TickerInfo()
    {
    }

    public TickerInfo(string name, string description)
    {
        Name = name ?? throw new ArgumentNullException(nameof(name));
        Description = description ?? throw new ArgumentNullException(nameof(description));
    }

    public string Name { get; set; } = string.Empty;
    public string Description { get; set; } = string.Empty;
}

Expected behavior
Filter continue working even if a custom template is set.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11 22H2
  • Browser: Edge
  • Version 4.15.9
Originally created by @enricobenedos on GitHub (Sep 6, 2023). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can report your issue or ask us a question via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. Specify all the steps required to reproduce the issue or link a project which reproduces it easily (without requiring extra steps such as restoring a database). --> **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: Working filtering: ```c# <RadzenDropDown Placeholder="Ticker" Data="@_tickerInfos" @bind-Value="@_selectedTickerInfo" ValueProperty="Name" TextProperty="Name" AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"> </RadzenDropDown> ``` Broken filtering with custom template ```c# <RadzenDropDown Placeholder="Ticker" Data="@_tickerInfos" @bind-Value="@_selectedTickerInfo" ValueProperty="Name" AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"> <Template> @($"{(context as TickerInfo)!.Name} - {(context as TickerInfo)!.Description}") </Template> </RadzenDropDown> ``` ```c# public class TickerInfo { public TickerInfo() { } public TickerInfo(string name, string description) { Name = name ?? throw new ArgumentNullException(nameof(name)); Description = description ?? throw new ArgumentNullException(nameof(description)); } public string Name { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; } ``` **Expected behavior** Filter continue working even if a custom template is set. **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: `Windows 11 22H2` - Browser: `Edge` - Version `4.15.9`
Author
Owner

@enchev commented on GitHub (Sep 6, 2023):

Filtering works with TextProperty.

@enchev commented on GitHub (Sep 6, 2023): Filtering works with TextProperty.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#977