Use Category attribute .Note that properties without the attribute will be shown uder category named "Misc"
[DisplayName("First Name")]
[Description("First Name of the person")]
[Category("Personality")]
public string FirstName
{
get
{
return _FirstName;
}
set
{
_FirstName = value;
}
}
[Category("Specific")]
public Color HairColor
{
get
{
return _HairColor;
}
set
{
_HairColor = value;
}
}
2 comments:
how does one remove the default category Misc. eg., create a poerty gridwtih only properties listed
Try to press "A-B" button - in this mode the property grid doesn't show categories .The code below presents
how to switch the mode programmatically .
// in this mode the categories will not be shown
propertyGrid1.PropertySort = PropertySort.NoSort;
// also you can hide the top property grid toolbar
propertyGrid1.ToolbarVisible = false;
Regards
Post a Comment