c# - How do I have an enum bound combobox with custom string formatting for enum values? -
In the post, a method for using custom attribute DescriptionAttribute is described as: < / [Details ("really nice")] [really good]], [description ("kina nice")] sortoffinis, [description ("absolutely not good")]
And then, you call the function GetDescription by using the syntax:
GetDescription & lt; HowNice & gt; (NotNice); But this does not really help me When I want to populate a combo box with the values of only one enum, because I can not force What do I need to have the following requirements: Obviously, I can apply a new class for every error which I can create and override its You can write a typewriter that reads to see the specific resources in your resources. In this way you will get multi-language support for the names of the exhibition without any hassle. Look at the convert / convert formats of type converter, and use reflection to read the attributes on your enum field . / P> GetDescription < Combo box to call / code> .
reading (HowNice) myComboBox The selected item will return the value selected as the value value. NotNice ", users will see " not good ". ToString () , but this is very much
Comments
Post a Comment