我有一个实现接口的泛型类(Parameters.cs):ICustomTypeDescriptor。
我将泛型类用于几个不同的类,其中之一是:
private Parameters<Class1> _class1Parameters;
public Parameters<Class1> Class1Parameters
{
get { return _class1Parameters; }
set { _class1Parameters= value; }
}类别1.cs:
public class Class1
{
private List<Position> _pos = new List<Position>();
public List<Position> Pos
{
get { return _pos ; }
set { _pos = value; }
}
//Other variables
}职位类别:
public class Position
{
public string Name { get; set; }
public double Position { get; set; }
}现在,这个列表显示在Propertygrid (“.”)中有三个点。
我想用Expander ("+")显示它,我们如何通过ICustomTypeDescriptor实现它?
编辑:
我试着把[TypeConverter(typeof(ExpandableObjectConverter))]放在Pos列表上,但没有帮助。
发布于 2013-04-10 11:30:51
最后,我设法通过这个网站:
PropertyGrid中集合数据的自定义显示
https://stackoverflow.com/questions/15895317
复制相似问题