M
mutex
Hi All,
Interesting problem.
SETUP:
Class A
{
string _name;
BCollection _b;
public string Name{get;set} -- code ommited sets/returns _name
public string BItemList{get;set} -- code ommited sets/returns
bcollection
}
Class B
{
string _id;
public string Name{get;set} -- code ommited returns _id
}
Class ACollection : CollectionBase
{
...Code ommited
}
Class BCollection : CollectionBase
{
...Code ommited
}
myControl : WebControl
{
ACollection _list;
[Bindable(true), Category("Data"),
DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Vis
ible),
NotifyParentPropertyAttribute(true),
PersistenceModeAttribute(PersistenceMode.InnerProperty ),
]
public virtual ACollection ItemList
{
get {return _list;}
}
So that is the setup. This is what WebForm designer will save in the aspx
file (uc1 is the registered tag prefix):
<uc1:myControl>
<ItemList>
<uc1:A Name="someting" BList="(Collection)" />
<ItemList>
</uc1:mycontrol>
Notice that BList is an attribute and its wrong, designer will throw an
error. So the question is, how to make VS Designer save BCollection so its
treated the same way as ACollection (like below) or any ideas on how to go
about it.
<uc1:myControl>
<ItemList>
<uc1:A Name="someting">
<BItemList>
<uc1:B Name="someting"/>
</BItemList>
</uc1:A>
<ItemList>
</uc1:mycontrol>
Thanks in advance.
Peter.
Interesting problem.
SETUP:
Class A
{
string _name;
BCollection _b;
public string Name{get;set} -- code ommited sets/returns _name
public string BItemList{get;set} -- code ommited sets/returns
bcollection
}
Class B
{
string _id;
public string Name{get;set} -- code ommited returns _id
}
Class ACollection : CollectionBase
{
...Code ommited
}
Class BCollection : CollectionBase
{
...Code ommited
}
myControl : WebControl
{
ACollection _list;
[Bindable(true), Category("Data"),
DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Vis
ible),
NotifyParentPropertyAttribute(true),
PersistenceModeAttribute(PersistenceMode.InnerProperty ),
]
public virtual ACollection ItemList
{
get {return _list;}
}
So that is the setup. This is what WebForm designer will save in the aspx
file (uc1 is the registered tag prefix):
<uc1:myControl>
<ItemList>
<uc1:A Name="someting" BList="(Collection)" />
<ItemList>
</uc1:mycontrol>
Notice that BList is an attribute and its wrong, designer will throw an
error. So the question is, how to make VS Designer save BCollection so its
treated the same way as ACollection (like below) or any ideas on how to go
about it.
<uc1:myControl>
<ItemList>
<uc1:A Name="someting">
<BItemList>
<uc1:B Name="someting"/>
</BItemList>
</uc1:A>
<ItemList>
</uc1:mycontrol>
Thanks in advance.
Peter.