WinForms Binding to Enum Properties

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
 
M

Mike

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Enum TypeConverter 3
about enum 3
Enum Extentions 7
enum with underlying type 1
Check Flags Enum for Validity 15
Enum To String 14
Merge Info From Two Enums 1
Enum extenting 3

Top