Skip to content

net90_PropertyGridHelpers.Attributes_EnumTextAttribute

dparvin edited this page Jan 11, 2026 · 15 revisions

EnumTextAttribute class

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.

Public Members

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.

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

Clone this wiki locally