WinForms Binding to Enum Properties

  • Thread starter Thread starter jehugaleahsa
  • Start date Start date
J

jehugaleahsa

Hello:

I would like to reuse an existing data object and bind it to a
WinForm. However, some of the properties are enums and so don't
display as I would like them to. Is there a way to tell WinForms to
automatically convert an Enum to a string going out to the form and
from a string to an enum on the way back?

I was looking at the TypeConverter class, but I'm not sure if it is
what I am looking for. Is this the class I want? It seems like a lot
of typing, is all.

Thanks,
Travis
 
Hello:

I would like to reuse an existing data object and bind it to a
WinForm. However, some of the properties are enums and so don't
display as I would like them to. Is there a way to tell WinForms to
automatically convert an Enum to a string going out to the form and
from a string to an enum on the way back?

I was looking at the TypeConverter class, but I'm not sure if it is
what I am looking for. Is this the class I want? It seems like a lot
of typing, is all.

Thanks,
Travis

Hi,

I think this is kinda more what you would be after:

http://www.ageektrapped.com/blog/the-missing-net-8-displaying-enums-in-windows-forms/

Cheers -Mike
 
Back
Top