[PR #543] [CLOSED] Bugfix: resolve duplicate enums in filters by grouping descriptions for duplicates #2233

Open
opened 2026-01-29 18:17:52 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/radzenhq/radzen-blazor/pull/543
Author: @ace90210
Created: 7/24/2022
Status: Closed

Base: masterHead: bugfix/duplicate-enums-in-filter


📝 Commits (1)

  • a826212 resolve duplicate enums by grouping descriptions for duplicates

📊 Changes

1 file changed (+6 additions, -4 deletions)

View changed files

📝 Radzen.Blazor/Extensions.cs (+6 -4)

📄 Description

This is a bugfix for #542. In brief currently there is a bug when using enums with duplicate values such as the official HttpStatusCode enum. The core issue is dropdowns do not allow duplicate values. as discussed in the Issue there are a number of solutions but this solution seems the cleanest, safest and quickest to implement for now.

This fix is to group duplicate ids and only list one dropdown item for each ID (resolving the duplicate issue) while appending each of the duplicate descriptions as a '/' seperated list. This resolves the issue without the user not being able to find the result they need but does have the downside of making the additional/duplicate descriptions potentially more likely to go beyond the width of the dropdown. Given the alternative is to not support (or exception in production) some enum types, this seems an appropriate compremise i am happy to deal with in my use case.

This change does not affect behaviour of existing enums with no duplicates


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/radzenhq/radzen-blazor/pull/543 **Author:** [@ace90210](https://github.com/ace90210) **Created:** 7/24/2022 **Status:** ❌ Closed **Base:** `master` ← **Head:** `bugfix/duplicate-enums-in-filter` --- ### 📝 Commits (1) - [`a826212`](https://github.com/radzenhq/radzen-blazor/commit/a826212cb1746e181799d402e657af724bbda188) resolve duplicate enums by grouping descriptions for duplicates ### 📊 Changes **1 file changed** (+6 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `Radzen.Blazor/Extensions.cs` (+6 -4) </details> ### 📄 Description This is a bugfix for #542. In brief currently there is a bug when using enums with duplicate values such as the official HttpStatusCode enum. The core issue is dropdowns do not allow duplicate values. as discussed in the Issue there are a number of solutions but this solution seems the cleanest, safest and quickest to implement for now. This fix is to group duplicate ids and only list one dropdown item for each ID (resolving the duplicate issue) while appending each of the duplicate descriptions as a '/' seperated list. This resolves the issue without the user not being able to find the result they need but does have the downside of making the additional/duplicate descriptions potentially more likely to go beyond the width of the dropdown. Given the alternative is to not support (or exception in production) some enum types, this seems an appropriate compremise i am happy to deal with in my use case. This change does not affect behaviour of existing enums with no duplicates --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 18:17:52 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#2233