net90_PropertyGridHelpers.Attributes_EnumTextAttribute_EnumTextAttribute - dparvin/PropertyGridHelpers GitHub Wiki

EnumTextAttribute constructor

Specifies a user-friendly text representation for an Enum field, primarily for display in a property grid or UI elements.

public EnumTextAttribute(string text)
parameter description
text The display text for the Enum field.

Remarks

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.

Examples

public enum Status
{
    [EnumText("Pending Approval")]
    Pending,

    [EnumText("Approved")]
    Approved,

    [EnumText("Rejected")]
    Rejected
}

See Also

⚠️ **GitHub.com Fallback** ⚠️