How Do I Group Properties by Category?

Quick Tip

Set the PropertyGrid.Grouping property to PropertyGrouping.ByCategory:

CopyGrouping the properties (declarative)
<ms:PropertyGrid Grouping='{x:Static ms:PropertyGrouping.ByCategory}'/>

In Depth

Grouping in WPF is done through collection views. The collection view for the WPF Property Grid is the default view of the PropertyGrid.BindingView collection. Setting the Grouping property as shown above is a shortcut for applying the ByCategory GroupDescription to this collection view.

For more flexibility, you can modify the PropertyGrid.BindingView.DefaultView.GroupDescriptions collection directly from code.

The ByCategory GroupDescription simply wraps an instance of the NodeToCategoryConverter around the Node property. NodeToCategoryConverter is available for you to use in creating your own grouping strategies.

You can also create your own GroupDescriptions and apply them via the Grouping property or the GroupDescriptions collection. For more information see the article Sorting and grouping in the WPF Property Grid on the Mindscape blog.