How to expose a control collection to a property grid at design time
- by Stefano Delendati
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;
}
}