L
lao.pan
I create a custom control with subcontrol.but in design-
time, subcontrol contents are clear by VS when I change
any attribute of the control.
why?
thank!
the main code is:
[
ParseChildren(false),
ControlBuilderAttribute(typeof(MyControlBuilder)),
]
public class MyCS_CustomControl: System.Web.UI.Control,
INamingContainer
{
private CellCollection _Items=new
CellCollection();
[
Category("Data"),
DefaultValue(null),
MergableProperty(false),
PersistenceMode
(PersistenceMode.InnerDefaultProperty),
]
public virtual CellCollection Items
{
get { return _Items; }
}
}
CellCollection is inherit from CollectionBase,Item is a
sample class
the html tag is:
<custom:mycs_customcontrol id="csTableId" title="C#
Custom1 Control Table" runat="server" columns="2"
rows="2">
<CUSTEM:MYCELL Text="RED"
BackColor="red" CellID="r1c1"></CUSTEM:MYCELL>
</custom:mycs_customcontrol></form>
at run-time all ok, but mycell clear in designtime when
control-attr changed.
time, subcontrol contents are clear by VS when I change
any attribute of the control.
why?
thank!
the main code is:
[
ParseChildren(false),
ControlBuilderAttribute(typeof(MyControlBuilder)),
]
public class MyCS_CustomControl: System.Web.UI.Control,
INamingContainer
{
private CellCollection _Items=new
CellCollection();
[
Category("Data"),
DefaultValue(null),
MergableProperty(false),
PersistenceMode
(PersistenceMode.InnerDefaultProperty),
]
public virtual CellCollection Items
{
get { return _Items; }
}
}
CellCollection is inherit from CollectionBase,Item is a
sample class
the html tag is:
<custom:mycs_customcontrol id="csTableId" title="C#
Custom1 Control Table" runat="server" columns="2"
rows="2">
<CUSTEM:MYCELL Text="RED"
BackColor="red" CellID="r1c1"></CUSTEM:MYCELL>
</custom:mycs_customcontrol></form>
at run-time all ok, but mycell clear in designtime when
control-attr changed.