RadzenDropDown IEqualityComparer Support #1529

Closed
opened 2026-01-29 17:54:59 +00:00 by claunia · 0 comments
Owner

Originally created by @pianomanjh on GitHub (Dec 14, 2024).

Is your feature request related to a problem? Please describe.
When binding a collection of objects to the RadzenDropDown, with Multiple=true, it is not always sufficient to rely on object.Equals to determine what items are selected, as it is not always possible to align object equality overrides with the needs of a dropdown.
One example is a collection bound as a many-to-many property of an Entity Framework collection. Overriding Equality on entity classes is not recommended, and indeed causes issues in this case.

Describe the solution you'd like
The ability to specify an IEqualityComparer to RadzenDropDown, to control how items are compared/selected.

Describe alternatives you've considered
Overriding Equals is what we had done, but ran into the issue described above. Other interfaces like IComparable don't seems appropriate, and aren't as useful/compatible with BCL collections.

Originally created by @pianomanjh on GitHub (Dec 14, 2024). **Is your feature request related to a problem? Please describe.** When binding a collection of objects to the `RadzenDropDown`, with `Multiple=true`, it is not always sufficient to rely on `object.Equals` to determine what items are selected, as it is not always possible to align object equality overrides with the needs of a dropdown. One example is a collection bound as a many-to-many property of an Entity Framework collection. Overriding Equality on entity classes is [not recommended](https://learn.microsoft.com/en-us/ef/core/change-tracking/identity-resolution#overriding-object-equality), and indeed causes issues in this case. **Describe the solution you'd like** The ability to specify an `IEqualityComparer` to `RadzenDropDown`, to control how items are compared/selected. **Describe alternatives you've considered** Overriding Equals is what we had done, but ran into the issue described above. Other interfaces like IComparable don't seems appropriate, and aren't as useful/compatible with BCL collections.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1529