-
Notifications
You must be signed in to change notification settings - Fork 1
net90_PropertyGridHelpers.Attributes_EnumTextAttribute
dparvin edited this page Jan 11, 2026
·
15 revisions
Specifies a user-friendly text representation for an Enum field, primarily for display in a property grid or UI elements.
[AttributeUsage(AttributeTargets.Field, Inherited = false)]
public class EnumTextAttribute : Attribute| parameter | description |
|---|---|
| text | The display text for the Enum field. |
| name | description |
|---|---|
| EnumTextAttribute(…) | Specifies a user-friendly text representation for an Enum field, primarily for display in a property grid or UI elements. |
| static Get(…) | Retrieves the EnumTextAttribute applied to the specified enum value. (3 methods) |
| EnumText { get; } | Gets the custom text associated with the enum field. |
| static Exists(…) | Determines whether the specified enum value has an associated EnumTextAttribute. |
This attribute can be applied to individual Enum fields to provide a custom display text. This is useful when showing Enum values in a PropertyGrid, dropdowns, or UI components where a more descriptive label is needed instead of the raw Enum name.
public enum Status
{
[EnumText("Pending Approval")]
Pending,
[EnumText("Approved")]
Approved,
[EnumText("Rejected")]
Rejected
}- namespace PropertyGridHelpers.Attributes
- assembly PropertyGridHelpers
- EnumTextAttribute.cs