PropertyGrid Grouping in C#.NET
KetticPropertyGrid control for Windows Forms includes various features for data processing, including grouping, sorting, and filtering. The grouping functionality can be easily added to your Windows Forms application by using the PropertyGrid control. There are two different approaches allow the users to group the displayed items in PropertyGrid, grouping properties based on Category attribute through predefined grouping capability or grouping properties by defining GroupDescriptors using C# code.
Predefined Grouping Capability through Category Attribute
KetticPropertyGrid provides predefined grouping capability to group properties in property grid. The end users are able to call the predefined grouping through clicking the group button in the tool bar or changing the PropertuSort property to Categorized or CategorizedAlphabetical using C# code. The Categorized setting will group the properties based on the Category attribute and display the properties as enlisted in the object. And the CategorizedAlphabetical setting will group the properties based on the Category attribute and display the properties in alphabetical. Customize Sorting Order in C# code
It is possible to adjust the sorting order by changing the SortOrder property using C# code. The following is the example that changing the category sorting by descending alphabetical.
Grouping Properties Manually in C#.NET Projects
To add grouping functionality to PropertyGrid, we must enable the EnableGrouping property by changing its value to true. And then we can add the desired GroupDescriptor to the GroupDescriptors collection of the KetticPropertyGrid. The following are the standards for filtering in PropertyGrid.
C# code for Adding a Group Descriptor
| ![]() 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 |