Welcome to Bangladesh Microsoft Technology Community Sign in | Join | Help

Tuesday, December 05, 2006 - Posts

Set Enum Value with reflection .Net1.1 and .Net2.0

While trying to set value for enum via Reflection I discovered .Net2.0 is much smarter in setting values.In .Net2.0 the following works: Int32 property = int.Parse("20");if (propertyInfo.CanWrite){   this.propertyInfo.SetValue(ParentPage.TheProperties,
posted by Shahed | 0 Comments

How to Get Enum Values with Reflection in C#

This came up when I was writing a UIProperty for SmartCodeGenerator, The combo box should display all the available enum options in a DropDownList for the enduser to choose from them.So if someone defines a enum like this:public enum MyEnum{ 
posted by Shahed | 0 Comments