UITypeEditor as a Control via PropertyDescriptor.GetEditor()

M

Marc Gravell

::: Question:
Does anyone know of a simple Control / UserControl implementation that hosts
a UITypeEditor? Or the correct way to call PropertyDescriptor.GetEditor()
and get a non-null result for usage in a Form?

::: Background:
Basically, I have a highly-dynamic (runtime) bespoke object model, and I
want to drop some (runtime-only) properties onto the form. As it happens,
the objects implement all the right interfaces for Binding to work, but this
still isn't ideal, since I still need to worry about all the combinations of
rules (which type of editor, contents of drop down lists, text parsing,
etc).

But I've already fixed this once! My object model works fine on a
PropertyGrid (for a different view), with TypeConverter implementations
happily dealing with all of this gunk, and merrily nesting all the
sub-objects etc (broadly similar to http://tinyurl.com/k3hyu).

I was hoping to simply create a Control / UserControl that wraps the
PropertyDescriptor and an object instance, and simply re-use the existing
functionality for viewing and editing the value with the TypeConverter
rules.

Has anyone tried this? Alas, google is determined to show me lots of pages
about compile-time usage... but if the PropertyGrid can be used successfully
at runtime, why not the UITypeConverter?

Marc
 
M

Marc Gravell

Please ignore me - I think I've sorted it out; GetEditor() presents the
popup editor, so I should be able to do something fun with a textbox /
combo-box and elipsis... essentially cloning a cell from the PropertyGrid...

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top