Pergunta

I have a generic class (Parameters.cs) that implements the interface: ICustomTypeDescriptor.

I use the generic class for several different classes, one of which is this:

    private Parameters<Class1> _class1Parameters;

    public Parameters<Class1> Class1Parameters
    {
        get { return _class1Parameters; }
        set { _class1Parameters= value; }
    }

Class1.cs:

public class Class1
{
    private List<Position> _pos = new List<Position>();

    public List<Position> Pos
    {
        get { return _pos ; }
        set { _pos = value; }
    }  

    //Other variables
}

Position class:

public class Position
{
    public string Name { get; set; }
    public double Position { get; set; }
}

Right now the list is displayed with three points in Propertygrid ("...").

I want it to be displayed with Expander ("+"), how can we do it through the ICustomTypeDescriptor?

EDIT:

I tried putting [TypeConverter(typeof(ExpandableObjectConverter))] over the Pos list, it did not help.

Foi útil?

Solução

Finally I managed to make it through this site:

Customized display of collection data in a PropertyGrid

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top