How can I go about inserting a Windows form as a data type for a PropertyGrid? The form will be used to edit data in a collection, but I don't want to use the default editor, which keeps popping up.
This is the class that brings the default collections editor (templated from CodeProject); I presume it's the CollectionBase that implements the editor:
Code:
class FieldList : CollectionBase
{
public CustomField this [ int index ]
{
get
{
return ( CustomField ) List [ index ];
}
}
public void Add( CustomField field )
{
List.Add( field );
}
public void Remove( int target )
{
List.RemoveAt( target );
}
}
Here is the property that the PropertyGrid uses to bind:
Code:
private FieldList fields;
[Category( "UserFields" )]
[DisplayName( "Fields" )]
[Description( "Fields created by the user." )]
public FieldList Fields
{
get
{
return fields;
}
set
{
fields = value;
}
}
But binding the editor to my data is a bit complicated, and I also have to do it by a specified method; a user form to manipulate the data. I already have the form. My issue is replacing the default editor with it...