Enum filters on DataGrid should allow the Enum name to be transformed #616

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

Originally created by @PhonicCanine on GitHub (Nov 2, 2022).

Is your feature request related to a problem? Please describe.
This feature is not tied to a bug, but it would be very useful to be able to specify a function to convert an enum to a string within RadzenDataGridColumn(s), as enum names are not always suitable for user-facing interfaces, but the utilities for filtering by enum value within a radzen table are very convenient.

Describe the solution you'd like
A parameter that takes a method from TEnum -> string that converts all of the values of a given enum to a string using that conversion function when rendering the filter menu.

Describe alternatives you've considered
An alternative solution is obviously to treat the enum strings as text always, but this strips much of their functionality, and means the filter no longer allows you to select enum values from a checklist. A custom filter template can also be used to achieve a similar effect.

Additional context
I can't think of any additional context. If this feature is agreeable though, I'm more than willing to implement it and create a PR for it myself.

I'm not certain what you would want from the syntax, given DataGridColumn uses a string for Property and therefore there would not be type information available at compile time for a TEnum -> String function.

Originally created by @PhonicCanine on GitHub (Nov 2, 2022). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can request your feature 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. --> **Is your feature request related to a problem? Please describe.** This feature is not tied to a bug, but it would be very useful to be able to specify a function to convert an enum to a string within RadzenDataGridColumn(s), as enum names are not always suitable for user-facing interfaces, but the utilities for filtering by enum value within a radzen table are very convenient. **Describe the solution you'd like** A parameter that takes a method from TEnum -> string that converts all of the values of a given enum to a string using that conversion function when rendering the filter menu. **Describe alternatives you've considered** An alternative solution is obviously to treat the enum strings as text always, but this strips much of their functionality, and means the filter no longer allows you to select enum values from a checklist. A custom filter template can also be used to achieve a similar effect. **Additional context** I can't think of any additional context. If this feature is agreeable though, I'm more than willing to implement it and create a PR for it myself. I'm not certain what you would want from the syntax, given DataGridColumn uses a string for `Property` and therefore there would not be type information available at compile time for a TEnum -> String function.
Author
Owner

@enchev commented on GitHub (Nov 2, 2022):

image
image

@enchev commented on GitHub (Nov 2, 2022): ![image](https://user-images.githubusercontent.com/5804953/199528584-a60d5998-adc8-46f0-88a8-b8444427161e.png) ![image](https://user-images.githubusercontent.com/5804953/199528651-6f4d3c00-1ac9-45f5-851a-82887e82a0e9.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#616