How to expose a control collection to a property grid at design time

Posted by Stefano Delendati on Stack Overflow See other posts from Stack Overflow or by Stefano Delendati
Published on 2010-03-29T14:31:07Z Indexed on 2010/03/29 14:33 UTC
Read the original article Hit count: 185

Filed under:
|
|

I have a custom control that with a property that is a collection of custom object. This custom object hava a reference to some component/controls.

When at design time I tray to add an item to the collection and select the object, VS tells me that the control is not serializable.

This is the code (simplified version - but not to much):

    public class ViewRefObj
    {

        public control view { get; set; }

        public ViewRefObj()
        {

        }

    }

    private List<ViewRefObj> _controls=new List<ViewRefObj>();
    public List<ViewRefObj> Views
    {
        get
        {
            return _controls;
        }
    }

© Stack Overflow or respective owner

Related posts about design-time

Related posts about winforms