Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
Enum Localization with UltraComboEditor
posted

Hello, I need to localize the enum values in a ComboBox. I've found a nice article on CodeProject that explains how to use a TypeConverter attribute to localize the values (http://www.codeproject.com/KB/cs/LocalizingEnums.aspx). I've created my custom EnumConverter to read from resource file the localized string, and I assign the data source to the control:

_enumListBox.DataSource = Enum.GetValues(typeof(SampleEnum));

if the _enumListBox is a System.Windows.Forms.ComboBox it shows the custom strings from resource file, but if is a UltraComboEditor, it shows the string name of the enum values. Why UltraComboEditor does not call the custom EnumConverter? Is there a way to workaround this issue?

Thanks   
Alessandro

  • 469350
    Suggested Answer
    Offline posted

    Hi Alessandro,

    I wasn't aware this functionality existed in DotNet to localize the display of enums. That's very interesting. I guess the ValueList is simply not taking advantage of that functionality.

    Anyway, you could easily achieve the same thing by populating the list with items that contain the enum value and the text you want to display as the DataValue and DisplayText of each item respectively.

    In the mean time, I will forward this over to Infragistics Developer Support so they can check it out and get it fixed.