C# PropertyGrid&;对象属性:类别
我正在做一个项目,包括查看和更改 具有PropertyGrid控件的类元素的属性。这个 类元素的属性是对其他对象的引用 (自身)有属性C# PropertyGrid&;对象属性:类别,c#,propertygrid,C#,Propertygrid,我正在做一个项目,包括查看和更改 具有PropertyGrid控件的类元素的属性。这个 类元素的属性是对其他对象的引用 (自身)有属性 [TypeConverter(typeof(ExpandableObjectConverter))] public abstract class Elemento { .... [CategoryAttribute("Materiale Associato 1"), DescriptionAttribute("Caratteristiche s
[TypeConverter(typeof(ExpandableObjectConverter))]
public abstract class Elemento
{
....
[CategoryAttribute("Materiale Associato 1"), DescriptionAttribute("Caratteristiche standard del Materiale 1")]
public Standard1 Standard1 {get;set;}
[CategoryAttribute("Materiale Associato 2"), DescriptionAttribute("Caratteristiche standard del Materiale 2")]
public Standard2 Standard2 {get;set;}
}
此对象将传递给SelectedObject属性(PropertyGrid)。
我想将类Standard1(和Standard2)的属性划分为
类别。我试着用这种方式来装饰房子:
[TypeConverter(typeof(Standard1Converter))]
public class Standard1
{
[CategoryAttribute("Property1")]
public AnObject Property {get;set;}
[CategoryAttribute("Property2"), DescriptionAttribute("A property")]
public AnObject Property2 {get;set;}
但是属性没有分组。我只看到描述。怎么了
注意:Standard1Converter:ExpandableObjectConverter标准MS PropertyGrid中没有子类别。这意味着只有传递给SelectedObject的顶级对象才会被分类。标准MS PropertyGrid中没有子类别。这意味着只有传递给SelectedObject的顶级对象才会被分类。您所说的“属性未分组”是什么意思。你到底期望什么?当我选择一个Elemento时,我看到(在propertyGrid中)按类别分组的属性(作为标准1),但当我“展开”对象时,相对属性Standard1没有分类。对不起,我的英语不好!你所说的“财产不分组”是什么意思。你到底期望什么?当我选择一个Elemento时,我看到(在propertyGrid中)按类别分组的属性(作为标准1),但当我“展开”对象时,相对属性Standard1没有分类。对不起,我的英语不好!