Binding To An Enumeration - A Followup

posted on 2005-09-26 at 00:41:10 by 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.

Categories: Development