Re: CollectionEditor - Add/Remove buttons are disabled
- From: "Alex Meleta" <ameleta@xxxxxxxxx>
- Date: Fri, 27 Apr 2007 23:14:56 +0400
U can use arrays against generics:
<http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=885160&SiteID=1>
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=885160&SiteID=1
WBR, Alex Meleta
Blog: http://devkids.blogspot.com
From: Dmitry Nogin [mailto:dmitrynogin@xxxxxxxxxxx]
Posted At: Freitag, 27. April 2007 22:17
Posted To: microsoft.public.dotnet.framework.windowsforms
Conversation: CollectionEditor - Add/Remove buttons are disabled
Subject: CollectionEditor - Add/Remove buttons are disabled
Hi,
Could you please suggest me some changes?
I've got the following code, which represents the small component with
collection property:
class Test : Component
{
private BindingList<Item> items = new BindingList<Item>();
[Editor(typeof(CollectionEditor), typeof(UITypeEditor)),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)
]
public IList<Item> Items
{
get { return items; }
}
}
class Item
{
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
}
Unfortunately, Add and Remove button in CollectionEditor popup dialog
are disabled. Why?
I tried to inherit from Collection Editor and use the following editor:
public class ItemCollectionEditor : CollectionEditor
{
public ItemCollectionEditor(Type type)
: base(type)
{
}
protected override Type CreateCollectionItemType()
{
return typeof(Item);
}
}
It didn't change anything? What's wrong about this snippet?
-- thanks
- Prev by Date: A more functional CheckedListBox?
- Next by Date: Re: Process.Start access not allowed for File
- Previous by thread: A more functional CheckedListBox?
- Next by thread: PDF output from report viewer looks distorted...
- Index(es):