A
A.J. van der Burg
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
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