Reputation: 143
I'm working on a project that involves viewing and changing the properties of a class element with the PropertyGrid control. The properties of the class element are references to other objects (themselves) have properties.
[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;}
}
This object will passed to the SelectedObject property (PropertyGrid). I would like to divide the properties of the class Standard1 (and Standard2) into categories. I tried to decorate the properties in this way:
[TypeConverter(typeof(Standard1Converter))]
public class Standard1
{
[CategoryAttribute("Property1")]
public AnObject Property {get;set;}
[CategoryAttribute("Property2"), DescriptionAttribute("A property")]
public AnObject Property2 {get;set;}
but the properties are not grouped. I see only the description. What is wrong?
NB: Standard1Converter : ExpandableObjectConverter
Upvotes: 1
Views: 1030
Reputation: 4745
There is no subcategories in the standard MS PropertyGrid. This means that only the top level object passed to SelectedObject will be categorized.
Upvotes: 1