"VisualHint" <cadilhac@gmail.com> wrote in message
news:1180269716.919676.82140@h2g2000hsg.googlegroups.com...
> Hello David,
>
> you will find a solution either with a TypeConverter or a custom
> TypeDescriptor. First let me tell you that the PropertyGrid resource
> list (see my signature) will give you a lot of pointers to handle
> these classes.
>
> Some of my customers had a similar question and I wrote a FAQ. It
> allows to dynamically set the possible values and the underlying
> integer identifiers in a combobox property. It is sometimes specific
> to Smart PropertyGrid but you will be able to grab the main ideas from
> it that you can apply to the Microsoft PropertyGrid. The link is:
>
http://www.visualhint.com/index.php/blog/post/how_to_setup_a_truly_dynamic_combobox_in_the_propertygrid/
>
> Another thing: if you want to determine the current displayed values
> for a property and the number of properties from inside your
> converter, use the context variable passed to the converter's methods.
> You will be able to access your target instance and request it the
> properties loaded from the database and their values.
>
> I hope this helps.
>
> Best regards,
>
> Nicolas Cadilhac @ VisualHint (
http://www.visualhint.com)
> Home of Smart FieldPackEditor.Net / DateTimePicker replacement
> Home of Smart PropertyGrid for .Net and MFC
> Microsoft PropertyGrid Resource List -
>
http://www.propertygridresourcelist.com >
>
> On May 26, 10:35 pm, David Thielen <thie...@nospam.nospam> wrote:
>> Hi;
>>
>> I have a property grid where I need to pass it an object with N
>> properties
>> in it that are each an enumeration (but not an enum). These properties
>> and
>> they enumerated values are read from a database - so we don't know
>> beforehand
>> how many there will be and we do not know beforehand what their
>> enumerated
>> values are.
>>
>> All of the examples for handling something like this show creating a
>> class
>> that implements TypeConverter and then passing that class. But we do not
>> know
>> what the choices are and we do not know how many of these properties we
>> will
>> have.
>>
>> If this was done by passing an object that implements TypeConverter this
>> would be a piece of cake - is there a way to do that?
>>
>> --
>> thanks - dave
>> david_at_windward_dot_net
http://www.windwardreports.com >>
>> Cubicle Wars -
http://www.windwardreports.com/film.htm >
>