Home > Net >  Display of an enum type
Display of an enum type

Time:09-19

Define an enumeration types as follows:
The namespace Model. FileEnum
{
Public enum SexEnum
{
[Description (" unknown ")]
UnKnown=0,
[Description (" male ")]
Man=1,
[Description (" female ")]
Wonman=2,
}
}
Var sexs=new List (a);
Gridcontrol. The datasource=sexs;
After the GridControl shows: UnKnow
How to let he shown as unknown or content in Chinese

CodePudding user response:

GetCustomAttribute
Write in Chinese

CodePudding user response:

reference 1st floor WQR1994 response:
GetCustomAttribute
Writing Chinese is good


I am a little white, where writing Chinese, or where to call GetCustomarrribute method?

CodePudding user response:

https://stackoverflow.com/questions/479410/enum-tostring-with-user-friendly-strings
  •  Tags:  
  • C#
  • Related