Help creating design-time properties

Discussion in 'ASP .Net Building Controls' started by C P, Apr 11, 2004.

  1. C P

    C P Guest

    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
    C P, Apr 11, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AG
    Replies:
    0
    Views:
    348
  2. Ravi Ambros Wallau
    Replies:
    0
    Views:
    4,085
    Ravi Ambros Wallau
    Jun 1, 2005
  3. flamesrock
    Replies:
    8
    Views:
    449
    Hendrik van Rooyen
    Nov 24, 2006
  4. Peter

    properties not showing in properties window at design time

    Peter, Dec 10, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    208
    Lostinet.Web Support
    Dec 10, 2003
  5. Ravi Ambros Wallau
    Replies:
    0
    Views:
    306
    Ravi Ambros Wallau
    Jun 1, 2005
Loading...

Share This Page