General.GetDisplayName Method
Extension method for getting enum items display name
Make sure each enum item has System.ComponentModel.DataAnnotations.DisplayAttribute.
eg [System.ComponentModel.DataAnnotations.Display(Name = "Email Contact", Description = "Email Contact from the
Contact Editor / Viewer")]
if the enum item doesn't have the attribute, the enum name is returned.
<Extension()> _
Public Shared Function GetDisplayName( _
ByVal value As Enum _
) As String
This language is not supported or no code example is available.
public static string GetDisplayName(
this Enum value
)
This language is not supported or no code example is available.
[Extension()]
public:
static String^ GetDisplayName(
Enum^ value
)
This language is not supported or no code example is available.
public
Extension()
static function GetDisplayName(
value : Enum
) : String;
This language is not supported or no code example is available.
Parameters
-
value
-
Enum
<default>
Return Value
string
.NET Framework
Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1