Those category names come from the System.ComponentModel.CategoryAttribute that decorate the public properties of the object being displayed in the property grid. Generally, the "Misc" category holds those properties that don't have this attribute. If you are displaying an object of your own making, then you need to add the attribute, which will move them out of "Misc". If you want to "move" other (inherited) properties, you need to override or hide them and change the attribute accordingly. To expand categories you can do this:
PropertyGrid pg = new PropertyGrid();
pg.ExpandAllGridItems(); // Expands all the categories in the System.Windows.Forms.PropertyGrid
pg.CollapseAllGridItems(); // Collapses all the categories in the System.Windows.Forms.PropertyGrid
// To expand/collapse a specific category
GridItem gi = pg.SelectedGridItem;
if (gi.GridItemType == GridItemType.Category)
{
gi.Expanded = true;
}
Scott Dorman
Microsoft® MVP - Visual C# | MCPD President - Tampa Bay IASA Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[Forum Guidelines][Articles][Blog]