473,320 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

UITypeEditor as a Control via PropertyDescriptor.GetEditor()

::: 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
Sep 19 '06 #1
2 7991
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
Sep 19 '06 #2
For anybody interested in this, most of the answers are here:
http://www.devx.com/dotnet/Article/20920/1954?pf=true

Finally I can use the same code for both the design-time property grid and
the run-time form ;-p

Marc
Sep 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ernest Morariu | last post by:
Hi All! The MyEditor class derives from UITypeEditor and its constructor has some parameters. I have to use EditorAttribute to associate MyEditor with a type or property. Question: it would...
1
by: margoulin | last post by:
Hi, I have a custom color selector control and a derived UITypeEditor allowing me tu use my color picker in a property grid. But I have to specifically call this editor for each property, like ...
9
by: James Geurts | last post by:
Hey all... I posted this in the vs.net ide group too, but people are not answering, so I figured that it might be more appropriate here. I'm not sure if I'm adding a designer to my code properly. ...
3
by: Sky Sigal | last post by:
I coming unglued... really need some help. 3 days chasing my tail all over MSDN's documentation ...and I'm getting nowhere. I have a problem with TypeConverters and storage of expandableobjects...
4
by: A Traveler | last post by:
Hello all, I have a control i wrote which inherits from asp:label. It worked fine. It extends asp:label with a "For" property which implements the "for" attribute of an html label tag (yes i...
0
by: Ken Dopierala Jr. | last post by:
Hi, When I change properties through the property window on my custom control and then move focus from that property cell VS.Net runs the GetDesignTimeHtml() method on my designer. When I...
2
by: Ahmed Hashish | last post by:
In building controls we need to create Custom UITypeEditor classes, most of this classes (in my case) doing the same job, its used to support the controls properties with a drop down list contains...
13
by: alex sparsky | last post by:
I have a custom collection in my c# winform ui control called Items. Items is a built in collection type that does not allow itself to be replace (you can't 'set' the itemscollection in the...
5
by: Jon Pope | last post by:
I've got a class which contains properties. I can supply this class to the Properties control, and it will properly display the properties and allow the user to edit them, etc. I would like to be...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.