StrataFrame Forum

Using the DevEx ColorEdit Control

http://forum.strataframe.net/Topic13884.aspx

By Bill Cunnien - 1/31/2008

Amazing!

I was having trouble figuring out how to get color from my DB (stored as string values) to stick to the color property of the ColorEdit control from DevExpress.  After searching various places for how I needed to format the datatype in the backend DB (since I was having trouble getting the control to work properly), it dawned on me that I was approaching this all wrong.  I left the datatype as is in the DB (string) and made an extremely simple change.  I modified the control so that the bound property was EditValue rather than Color (this is the same as what I did with the PictureEdit control). 

BAM!  w00t  It works beautifully!!

Thanks, again, StrataFrame and all of the gurus behind this framework.  You are making my life easier and easier every day!! Smile

Bill

By StrataFrame Team - 2/1/2008

You could also store a color in the database as an integer... ARGB.  Then override the property on the business object within the BOMapper to use the Color.FromArgb() method and Color.ToArgb() method for getting/setting the property.  That's what we ended up doing... saves a little bit of space in the database.
By Bill Cunnien - 2/1/2008

Sounds like a good plan.  Perhaps I will introduce this the next time I need to create a color column in the DB.  Fortunately, the column that I am working on is simply for a lookup type table (statuses), so they are quite limited (I think 10 rows so far).

Thanks a ton!
Bill