I've been using the PropertyBag class to build up a set of properties to pass to a PropertyGrid control. However, it required passing a type for each enum to list the strings and that meant creating a StringTypeConverter derived class for each enum - which is a problem if you will have N enums.
Download PropertyBag.cs is derived from the original but includes a property constructor that takes an array of string rather than a type and displays those strings as the enum choices. I made a couple of other small edits to the original code but otherwise it's the original PropertyBag.
Answer
To set a default property you do it like for any other property - you just do:
PropertyTable props = ...
props["name"] = value;
Do you find this useful? If so please check out Windward Reports.
I know it's a bit late, but thanks, I needed this! :D
Posted by: Bob | March 16, 2010 at 04:13 AM
I will do the coding tomorrow, but I am already almost sure that you saved me much time :)
Thanks!
Posted by: machekku | May 28, 2008 at 04:39 PM
Do you have a way to set a default value for the Array passed in?
Posted by: Andrew Roberts | August 21, 2007 at 09:23 PM