Sorting of PropertyGrid in C#.NET
KetticPropertyGrid control provides sorting capabilities to sort items in .NET Windows applications. It is easy to add the sorting functionality to the PropertyGrid control. There are two approaches available to this. One is to apply the sorting options predefined in the PropertySort property with the SortOrder property. The other one is to apply custom sorting through adding a predefined SortDescriptor to KetticPropertyGrid SortDescriptors collection.
Apply Sorting to KetticPropertyGrid Items in C#.NET
The following are the C# code that demonstrates how to add sorting to KetticPropertyGrid items and sort items according to the value of items in an ascending order.
Sort Items using SortDescriptor in C#.NET projects
KetticPropertyGrid .NET component also allows the users to apply item sorting through adding a predefined SortDescriptor to the SortDescriptors collection of the PropertyGrid control. While using this approach, we should change the EnableSorting property to true to enable the sorting with sort descriptors. The following are the standards used for sorting in KetticPropertyGrid.
C# code for Sorting with SortDescriptors
The following is a sample that shows how to apply sorting to KetticPropertyGrid items according to Alphabetical in descending order.
| ![]() UI Controlsfor Windows Forms .NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI DesignWinForms UI Controls WinForms Buttons UI Control WinForms Calendar UI ControlWinForms Carousel UI ControlWinForms Chart UI ControlWinForms Clock UI ControlCommandBar UI ControlWinForms Dock UI ControlDesktop Alert UI ControlDropDown List UI ControlWinForms Editor UI ControlForms and Dialogs UI ControlWinForms GridView UI ControlWinForms ListView UI ControlWinForms Menu UI ControlWinForms ComboBox UI ControlWinForms PageView UI ControlPanels and Labels UI ControlWinForms Panorama UI ControlWinForms PDFViewer UI ControlWinForms Property Grid UI ControlGet Started in C#Property Grid - AttributeAdd Custom PropertiesBinding to Multiple ObjectsProperty Grid - CustomizationProperty Grid - LocalizationProperty Grid - EditorsC# API & EventsValidationCustomizing Editor BehaviorHandle EventsProperty Grid - FeaturesFeatures - filteringFeatures - GroupingCustom GroupingFeatures - SortingFeatures - Help BarFeatures - Tool BarWinForms Ribbon UI ControlWinForms PivotGrid UI ControlWinForms RichTextBox UI ControlWinForms Rotator UI ControlWinForms Scheduler UI ControlWinForms Shortcuts UI ControlWinForms SpellChecker UI ControlWinForms Track & Status UI ControlWinForms TreeView UI ControlWinForms Wizard UI ControlWinForms Test UI ControlWinForms Theme UI Control |