StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Using the DevEx ColorEdit ControlExpand / Collapse
Author
Message
Posted 01/31/2008 3:15:02 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 3:04:50 PM
Posts: 367, Visits: 1,315
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!   It works beautifully!!

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

Bill

Post #13884
Posted 02/01/2008 8:43:00 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 9:09:33 AM
Posts: 2,661, Visits: 1,876
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.


www.bungie.net
Post #13905
Posted 02/01/2008 1:14:12 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 3:04:50 PM
Posts: 367, Visits: 1,315
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

Post #13939
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 8:05pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.062. 9 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.