0

I have a custom ObjectCollection class in my custom control and a public property to access this collection.

//My custom Property
[Editor("System.Windows.Forms.Design.StringCollectionEditor",typeof(UITypeEditor))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public ObjectCollection Items
{
    get { return itemCollection; }
}

//My custom collection class
[ListBindable(false)]
public class ObjectCollection : IList, ICollection, IEnumerable
{
  //code
}

However, the values are NOT getting persisted. In design mode if I save strings in StringEditor by clicking OK button, close it, and reopen it, then the strings are gone.
Any idea?

2
Contributors
1
Reply
8
Views
4 Years
Discussion Span
Last Post by TnTinMN
0

The StringCollectionEditor is for editing an object of type System.Collections.Specialized.StringCollection or a class that inherits from it. It implements all the interfaces you have specified for your class, but have provide the methods that specifying those interface requires you to do?

See: http://msdn.microsoft.com/en-us/library/87d83y5b%28v=VS.80%29.aspx

Also, you may need to change "System.Windows.Forms.Design.StringCollectionEditor" to "System.Windows.Forms.Design.StringCollectionEditor, System.Design"

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.