Geeks With Blogs
Joel Ross

Late last week, I posted about being able to bind to an enumeration, and expressed my doubt of it's usefulness in most situations.

Well, I was Haacked! Phil posted a followup of how it could be done. Remember, my doubts were because of situations where your enumerations are often times multiple words, and not having spaces would create a problem. Phil, using the ever useful UglinessFactor enumeration, introduces the SplitUpperCaseToString function, which, as long as your enmerations follow Pascal casing (which they should), will split your enumerations into nice, readable drop down values. Nice trick! You can then call this function on binding of each item, and be good to go.

Now, as pointed out in the comments, this is (obviously) not a localizable solution. If you're in need of that, then binding to an enumeration probably wouldn't work for you anyway - even if you do only use single word enumeration values.

Posted on Sunday, September 25, 2005 9:26 PM | Back to top


Comments on this post: Binding To An Enumeration - A Followup

No comments posted yet.
Your comment:
 (will show your gravatar)
 


Copyright © Joel Ross | Powered by: GeeksWithBlogs.net | Join free