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?

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"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.