I have created a control which main class (with attributes) is:
[DefaultProperty("Text"),ToolboxData("<{0}:MioCmd runat=server></{0}:MioCmd>"),
ParseChildren(ChildrenAsProperties = false),
ControlBuilderAttribute(typeof(MioCmd.MioBuilder)) ,
Designer("MioCmd.MioDesigner, MioCmd"),
PersistChildren(false)]
public class MioCmd : WebControl, INamingContainer{
....
}
into MioCmd I have an attribute with this declaration:
[Bindable(false),
Description("Imposta i comandi dell'editor."),
NotifyParentProperty(false),
RefreshProperties(RefreshProperties.All),
PersistenceMode(PersistenceMode.InnerDefaultProper ty)]
public ComandiCollection Comandi{
set{this.objComandi = value;}
get{return this.objComandi;}
}
the type of this attribute is derived from ControlCollection and the class has this declaration:
public class ComandiCollection : ControlCollection, IEnumerable{
....
}
ComandiCollection is a Collection of child controls of type Comando which inherits from Control:
[DefaultProperty("CommandId"), Bindable(false)]
public class Comando : Control{
....
}
My problem is that everytime I try to change the property Comandi through Visual Studio collection editor I'm not able to Add/Remove elements (the two buttons are disabled!!!) and every change that I made Isn't visible in the main window by now, but It is visible only after switching from visual editor to code editor and back to visual editor...
I really don't know how to solve this problem...do I have to change architecture or do I have to made some little changes?...if you have an Idea please help me!!!
ciao