C
cpnet
I'm trying to build a User Control in C# for ASP.NET 2.0. My user control
contains two ListBoxes. I am exposing the Items property of each ListBox as
public properties of my User Control. That part works ok. But, I can't get
a collection editor to show for the items properties of my User Control.
How can I do this? Here's what I'm trying so far:
[EditorBrowsable(EditorBrowsableState.Always)]
[Editor("System.ComponentModel.Design.CollectionEditor",
typeof(System.Drawing.Design.UITypeEditor)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public ListItemCollection Items1
{
get
{
return ListBox1.Items;
}
}
I see my "Items1" property in the property page in VS2005 at design time,
but the button to open up the collection editor is not there. I've tried
different combinations of the attributes above to no avail. What am I doing
wrong? Does ListItemCollection have a default Editor that should just show
up if I don't include any attributes (this doesn't happen for me)?
Thanks,
cpnet
contains two ListBoxes. I am exposing the Items property of each ListBox as
public properties of my User Control. That part works ok. But, I can't get
a collection editor to show for the items properties of my User Control.
How can I do this? Here's what I'm trying so far:
[EditorBrowsable(EditorBrowsableState.Always)]
[Editor("System.ComponentModel.Design.CollectionEditor",
typeof(System.Drawing.Design.UITypeEditor)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public ListItemCollection Items1
{
get
{
return ListBox1.Items;
}
}
I see my "Items1" property in the property page in VS2005 at design time,
but the button to open up the collection editor is not there. I've tried
different combinations of the attributes above to no avail. What am I doing
wrong? Does ListItemCollection have a default Editor that should just show
up if I don't include any attributes (this doesn't happen for me)?
Thanks,
cpnet