PersistChildrenAttribute class and collections in design-time prob

Discussion in 'ASP .Net Building Controls' started by A.J. van der Burg, Feb 7, 2005.

  1. Hi all,

    I have a problem with maintaning the elements of a collection in design
    time. I have a custom webcontrol, which in turn has a collection of child
    controls. When I use the PersistChildenAttribute class, this collection is
    not maintained when viewing the control in design time. In runtime,
    everything is OK. Here are some designer settings of the classes involved:

    [DefaultProperty("Tabs"),
    DefaultEvent("SelectedIndexChanged"),
    ToolboxData("<{0}:TabControl runat=server></{0}:TabControl>"),
    ToolboxBitmap(typeof(TabControl), "Icons.TabControlIcon.bmp"),
    Designer(typeof(TVW.Web.UI.Design.WebControls.TabControlDesigner)),
    ParseChildren(true, "Tabs"),
    PersistChildren(true)]

    The collection has the following attributes:
    [PersistenceMode(PersistenceMode.InnerDefaultProperty),
    MergableProperty(false),
    DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]

    If I remove the PersistChildrenAttribute everything works ok in design-time,
    but I want to persist the controls created at a lower level (within the
    collection), so basically I'm stuck. Does anyone have any ideas?

    TIA,

    Arnold Jan van der Burg
     
    A.J. van der Burg, Feb 7, 2005
    #1
    1. Advertising

  2. A.J. van der Burg wrote:

    > Hi all,
    >
    > I have a problem with maintaning the elements of a collection in design
    > time. I have a custom webcontrol, which in turn has a collection of child
    > controls. When I use the PersistChildenAttribute class, this collection is
    > not maintained when viewing the control in design time. In runtime,
    > everything is OK. Here are some designer settings of the classes involved:
    >
    > [DefaultProperty("Tabs"),
    > DefaultEvent("SelectedIndexChanged"),
    > ToolboxData("<{0}:TabControl runat=server></{0}:TabControl>"),
    > ToolboxBitmap(typeof(TabControl), "Icons.TabControlIcon.bmp"),
    > Designer(typeof(TVW.Web.UI.Design.WebControls.TabControlDesigner)),
    > ParseChildren(true, "Tabs"),
    > PersistChildren(true)]
    >
    > The collection has the following attributes:
    > [PersistenceMode(PersistenceMode.InnerDefaultProperty),
    > MergableProperty(false),
    > DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
    >
    > If I remove the PersistChildrenAttribute everything works ok in
    > design-time, but I want to persist the controls created at a lower level
    > (within the collection), so basically I'm stuck. Does anyone have any
    > ideas?
    >
    > TIA,
    >
    > Arnold Jan van der Burg

    Perhaps you need to write your own support for serialization.
     
    Nicole Schenk, Feb 8, 2005
    #2
    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. Doug Poland
    Replies:
    9
    Views:
    736
    VisionSet
    Sep 27, 2003
  2. flamesrock
    Replies:
    8
    Views:
    478
    Hendrik van Rooyen
    Nov 24, 2006
  3. xen
    Replies:
    22
    Views:
    832
    Jim Garrison
    Oct 6, 2007
  4. mutex
    Replies:
    0
    Views:
    216
    mutex
    Jul 27, 2003
  5. Pieter

    design time support for collections

    Pieter, Jun 9, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    122
Loading...

Share This Page