Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 2.02 KB

File metadata and controls

30 lines (22 loc) · 2.02 KB

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)