Help creating design-time properties

C

C P

I've created 2 web controls MyControlParentClass, and MyControlChildClass
(both are direct WebControl descendents). MyControlParentClass has a
property of type MyControlChildClass. If I add a MyControlParentClass to a
web form, then add a few MyControlChildClass controls to the form as well, I
want to see a drop down list of the MyControlChildClass controls in the
property editor for my MyControlParentClass control. This part works fine,
but if I save my form then close and re-open it, the selected
MyControlChildClass has disappeared.

I've looked at all the examples I can find on MSDN and google (in particular
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=214342). But I
can't get this to work. At first I thought I'd need a TypeConverter
descendent to get the drop down list to even appear, but it seems to appear
without me doing anything with a TypeConverter. Maybe the TypeConverter is
what I need to implement to get the property to be persistent when I save my
web form?

I'm not trying to do anything fancy with the property. The
MyControlChildClass property of MyControlParentClass should simply show the
ID's of the available MyControlChildClass controls in the property editor at
design time. And of course setting the MyControlChildClass property at
runtime to the ID of a MyControlChildClass should set this property to an
instance of MyControlChildClass.

Thanks for any help,
Chris
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top