[Editor(typeof(CollectionEditor), typeof(UITypeEditor))]
public MyCollection CollectionPropertyName
{
get;
set;
}
}
Does your team use the VSIP toolkit or maybe have the bulk of your app factored down to patterns and generators? Do you need in-house controls that will make your current vendors blush? If so, we need to talk.
public class clmn
{
public string colmnDataName;
public string colmnDesignName;
public bool bind;
public clmn() { }
public clmn(string s1, string s2, bool b1)
{
colmnDataName = s1;
colmnDesignName = s2;
bind = b1;
}
}
public class clmnCollection : List
{
}
[DefaultProperty("Text")]
[ToolboxData("<{0}:RecListControl runat=server></{0}:RecListControl>")]
public class RecListControl : CompositeControl
{
clmnCollection _Columns = null;
[Bindable(true)]
[Category("Options")]
[Description("The Columns")]
[Editor(typeof(CollectionEditor), typeof(UITypeEditor))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[MergableProperty(false)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)]
[NotifyParentProperty(true)]
public clmnCollection Columns
{
get
{
EnsureChildControls();
return _Columns ;
}
set
{
EnsureChildControls();
_Columns = value;
ViewState["Columns"] = value;
}
}
}
Does your team use the VSIP toolkit or maybe have the bulk of your app factored down to patterns and generators? Do you need in-house controls that will make your current vendors blush? If so, we need to talk.
Does your team use the VSIP toolkit or maybe have the bulk of your app factored down to patterns and generators? Do you need in-house controls that will make your current vendors blush? If so, we need to talk.
lior3790
Member
40 Points
25 Posts
How can I change the subobject in a composite control arraylist property to be editable in the de...
Jan 04, 2007 09:24 AM|LINK
Hi,
i have created a composite control and i give to one of the properties an Arraylist value which i intend to fill with a struct that i will define.
but the prob is when i choose to add in the design mode i get into the collection System.Object that cann't be defined or edit.
what is the solution?
Jonathan Dav...
Participant
1048 Points
234 Posts
Re: How can I change the subobject in a composite control arraylist property to be editable in th...
Jan 04, 2007 02:58 PM|LINK
{
}
class MyControl : WebControl
{
[Editor(typeof(CollectionEditor), typeof(UITypeEditor))]
public MyCollection CollectionPropertyName
{
get;
set;
}
}
lior3790
Member
40 Points
25 Posts
Re: How can I change the subobject in a composite control arraylist property to be editable in th...
Jan 04, 2007 03:25 PM|LINK
nice, it gave me the option to edit
but i get only two fields to edit: capacity & count
and dont take any field that required
here is the code
public class clmn : List { public string colmnDataName; public string colmnDesignName; public bool bind; public clmn() { } public clmn(string s1, string s2, bool b1) { colmnDataName = s1; colmnDesignName = s2; bind = b1; } } [DefaultProperty("Text")] [ToolboxData("<{0}:RecListControl runat=server></{0}:RecListControl>")] public class RecListControl : CompositeControl { List clm = new List(); [Bindable(true)] [Category("Options")] [Description("The Columns")] [Editor(typeof(CollectionEditor), typeof(UITypeEditor))] [PersistenceMode(PersistenceMode.InnerProperty)] [MergableProperty(false)] [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)] [NotifyParentProperty(true)] public clmn SetColumns { get { EnsureChildControls(); //if (((object)ViewState["Columns"]) == null) // return clmn; return ((clmn) ViewState["Columns"]); } set { EnsureChildControls(); clm.Add(value); ViewState["Columns"] = value; } } }lior3790
Member
40 Points
25 Posts
Re: How can I change the subobject in a composite control arraylist property to be editable in th...
Jan 04, 2007 03:26 PM|LINK
nice, it gave me the option to edit
but i get only two fields to edit: capacity & count
and dont take any field that required
here is the code
public class clmn : List { public string colmnDataName; public string colmnDesignName; public bool bind; public clmn() { } public clmn(string s1, string s2, bool b1) { colmnDataName = s1; colmnDesignName = s2; bind = b1; } } [DefaultProperty("Text")] [ToolboxData("<{0}:RecListControl runat=server></{0}:RecListControl>")] public class RecListControl : CompositeControl { List clm = new List(); [Bindable(true)] [Category("Options")] [Description("The Columns")] [Editor(typeof(CollectionEditor), typeof(UITypeEditor))] [PersistenceMode(PersistenceMode.InnerProperty)] [MergableProperty(false)] [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)] [NotifyParentProperty(true)] public clmn SetColumns { get { EnsureChildControls(); //if (((object)ViewState["Columns"]) == null) // return clmn; return ((clmn) ViewState["Columns"]); } set { EnsureChildControls(); clm.Add(value); ViewState["Columns"] = value; } } }Jonathan Dav...
Participant
1048 Points
234 Posts
Re: How can I change the subobject in a composite control arraylist property to be editable in th...
Jan 04, 2007 04:30 PM|LINK
Jonathan Dav...
Participant
1048 Points
234 Posts
Re: How can I change the subobject in a composite control arraylist property to be editable in th...
Jan 04, 2007 04:32 PM|LINK
clmnCollection : System.Collections.Generic.List < clmn >
lior3790
Member
40 Points
25 Posts
Re: How can I change the subobject in a composite control arraylist property to be editable in th...
Jan 07, 2007 12:14 PM|LINK
I got a correct answer from Microsoft MSDN.
Here is the solution:
You need to encapsulate the member variables in Properties:public class clmn : List<clmn>{private string colmnDataName;public string ColmnDataName{get { return colmnDataName; }set { colmnDataName = value; }}private string colmnDesignName;public string ColmnDesignName{get { return colmnDesignName; }set { colmnDesignName = value; }}private bool bind;public bool Bind{get { return bind; }set { bind = value; }}public clmn() { }public clmn(string s1, string s2, bool b1){colmnDataName = s1;colmnDesignName = s2;bind = b1;}}This is because the type editor uses Reflection to discover bindableproperties, not public member variables.Hope this helps.Thank you Microsoft