Skip to content

Sort object properties in a custom order in the WinForms Property Grid.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/winforms-property-grid-custom-sorting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

DevExpressExampleBotDevExpressExampleBot
DevExpressExampleBot
and
DevExpressExampleBot
Apr 30, 2025
47ad471 · Apr 30, 2025

History

26 Commits
Mar 4, 2025
Apr 30, 2025
Apr 30, 2025
Apr 23, 2018
Apr 23, 2018
Apr 23, 2018
Aug 29, 2024
Apr 23, 2018

Repository files navigation

WinForms Property Grid - Sort properties in a custom order

The WinForms Property Grid control sorts properties by display name. This example handles the CustomPropertyDescriptors event to sort object properties in a custom order:

void propertyGridControl1_CustomPropertyDescriptors(object sender, CustomPropertyDescriptorsEventArgs e) {
    if(allowCustomSorting && e.Context.PropertyDescriptor == null) {
        e.Properties = e.Properties.Sort(new string[] { "Property5", "Property4", "Property3", "Property2", "Property1" });
    }
}

Files to Review

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)