DataFilter not setting FilterValue in Custom RadzenDataFilterProperty #1410

Closed
opened 2026-01-29 17:53:18 +00:00 by claunia · 3 comments
Owner

Originally created by @nikminer on GitHub (Oct 1, 2024).

DataFilter not setting FilterValue in Custom RadzenDataFilterProperty

image

To Reproduce
Steps to reproduce the behavior:

  1. Open 'radzen-blazor-master\RadzenBlazorDemos\Pages\DataFilterODataPage.razor'
  2. Scroll down to 'OnAfterRenderAsync'
  3. In 'if (firstRender)' statement add
    await dataFilter.AddFilter(new CompositeFilterDescriptor() { Property = "Employee.Title", FilterValue = new List<string>() { "Sales Manager" }, FilterOperator = FilterOperator.Contains });
  4. Open in browser 'localhost:5001/datafilter-odata'
  5. See empty dropdown and sorted data in the datagrid on 'Employee Title' property

image

Originally created by @nikminer on GitHub (Oct 1, 2024). DataFilter not setting FilterValue in Custom RadzenDataFilterProperty ![image](https://github.com/user-attachments/assets/3baa039a-2d10-412b-a2f7-7cc6061d0c02) **To Reproduce** Steps to reproduce the behavior: 1. Open 'radzen-blazor-master\RadzenBlazorDemos\Pages\DataFilterODataPage.razor' 2. Scroll down to 'OnAfterRenderAsync' 3. In 'if (firstRender)' statement add `await dataFilter.AddFilter(new CompositeFilterDescriptor() { Property = "Employee.Title", FilterValue = new List<string>() { "Sales Manager" }, FilterOperator = FilterOperator.Contains });` 4. Open in browser 'localhost:5001/datafilter-odata' 5. See empty dropdown and sorted data in the datagrid on 'Employee Title' property ![image](https://github.com/user-attachments/assets/b4e79f8a-31cb-4166-98e5-4fd2cc343f51)
Author
Owner

@enchev commented on GitHub (Oct 2, 2024):

This property is already bound and you need a bit more code to achieve your goal:
image

image

Use our forum in the future for such posts.

@enchev commented on GitHub (Oct 2, 2024): This property is already bound and you need a bit more code to achieve your goal: ![image](https://github.com/user-attachments/assets/533aa0e0-33b1-482f-b6a7-8b323e4dcf18) ![image](https://github.com/user-attachments/assets/ce86152d-1ea3-41b2-b02e-145f2bb17178) Use our forum in the future for such posts.
Author
Owner

@nikminer commented on GitHub (Oct 2, 2024):

Sorry, but this is not a very good solution and looks like a bug, it doesn't take into account what will happen if we add another filter here, for example containing "DoesNotContain", if what happens is:

image

I chose "Sales Representative" for "DoesNotContain" and "Vice President, Sales" for "Contain". What Makes Custom RadzenDataFilterProperty Useless for Users.

@nikminer commented on GitHub (Oct 2, 2024): Sorry, but this is not a very good solution and looks like a bug, it doesn't take into account what will happen if we add another filter here, for example containing "DoesNotContain", if what happens is: ![image](https://github.com/user-attachments/assets/33e5e7f5-bbbb-4ab1-af47-13d31404c3c8) I chose "Sales Representative" for "DoesNotContain" and "Vice President, Sales" for "Contain". What Makes Custom RadzenDataFilterProperty Useless for Users.
Author
Owner

@nikminer commented on GitHub (Oct 2, 2024):

Found another solution:

  1. Delete list "selectedTitles" and everything connected to it.
  2. Change property 'Value' in "RadzenDropDown" into 'MyCustomEnumerableDataFilterProperty' using "context" like:
    image
@nikminer commented on GitHub (Oct 2, 2024): Found another solution: 1. Delete list "selectedTitles" and everything connected to it. 2. Change property 'Value' in "RadzenDropDown" into 'MyCustomEnumerableDataFilterProperty' using "context" like: ![image](https://github.com/user-attachments/assets/f38cdf73-b0aa-49fc-bab7-646098919654)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1410