Implement Syncfusion WPF PropertyGrid for browsing and editing object properties with custom editors and category editors. Use this when building property inspectors, property panels similar to Visual Studio's Properties window, or dynamically inspecting and editing object properties in WPF. Covers custom value editors, category editors, collection editing, and design-time property editor customization.
Implement Syncfusion WPF PropertyGrid for browsing and editing object properties with custom editors and category editors. Use this when building property inspectors, property panels similar to Visual Studio's Properties window, or dynamically inspecting and editing object properties in WPF. Covers custom value editors, category editors, collection editing, and design-time property editor customization.
metadata
{"author":"Syncfusion Inc","version":"34.1.29"}
Implementing PropertyGrid
Guide for implementing Syncfusion® WPF PropertyGrid control — a powerful property inspector for browsing and editing object properties with support for custom editors, category editors, collection editing, grouping, sorting, filtering, and nested properties.
When to Use This Skill
Use this skill when you need to:
Display object properties for browsing and editing
Create property inspectors similar to Visual Studio's Properties window
Implement custom value editors for specific property types
Group and categorize properties for better organization
Edit collection properties with add/remove/edit capabilities
Filter and search properties dynamically
Support nested properties with expandable property items
Customize property display with descriptions, display names, and tooltips
Implement design-time editors for visual configuration tools
Build configuration panels for application settings
This skill covers the complete PropertyGrid implementation including basic setup, property binding, editors, organization, and advanced customization.
privatevoidPropertyGrid_ValueChanged(object sender, ValueChangedEventArgs e)
{
var changedProperty = e.Property;
var oldValue = e.OldValue;
var newValue = e.NewValue;
// Log the change
Console.WriteLine($"{changedProperty.Name} changed from {oldValue} to {newValue}");
// React to specific property changesif (changedProperty.Name == "Age")
{
// Validate or update related properties
}
}
Key Properties
Core Properties
Property
Type
Description
SelectedObject
object
The object whose properties are displayed
SelectedObjects
object[]
Multiple objects for common property editing
EnableGrouping
bool
Groups properties by category
SortDirection
ListSortDirection?
Sorts properties (Ascending, Descending, null)
PropertyExpandMode
PropertyExpandModes
FlatMode or NestedMode for complex objects
AutoGenerateItems
bool
Auto-generates property items (default: true)
UI Configuration
Property
Type
Description
SearchBoxVisibility
Visibility
Shows/hides the search box
ButtonPanelVisibility
Visibility
Shows/hides sort/group buttons
DescriptionPanelVisibility
Visibility
Shows/hides description panel
EnableToolTip
bool
Enables tooltips on property items
DisableAnimationOnObjectSelection
bool
Disables loading animation
Collections
Property
Type
Description
HidePropertiesCollection
ObservableCollection
Property names to hide
CustomEditorCollection
CustomEditorCollection
Custom editors for properties
Items
PropertyGridItemCollection
Manually defined property items
Events
Event
Description
AutoGeneratingPropertyGridItem
Fired when a property item is being created (can cancel or modify)
ValueChanged
Fired when a property value changes
SelectedPropertyItemChanged
Fired when the selected property changes
CollectionEditorOpening
Fired before collection editor opens (can cancel or set readonly)
Common Use Cases
1. Application Settings Editor
Display and edit application configuration with grouped categories (Appearance, Behavior, Performance).
2. Design-Time Property Inspector
Create visual designers for custom controls or components with property editing.
3. Object Inspector in Development Tools
Build debugging or inspection tools to view and modify object properties at runtime.
4. Dynamic Configuration Panels
Generate configuration UI automatically from data model classes without manual form design.
5. Data Entry Forms with Complex Objects
Display nested object properties with collections, allowing users to edit hierarchical data.
6. Report Parameter Configuration
Allow users to configure report parameters with appropriate editors for each data type.
7. Game/Application Asset Editor
Edit properties of game objects, scenes, or assets with custom editors for vectors, colors, resources.
8. Business Rule Configuration
Define and edit business rules with property-based configuration and validation.
Consider manual property definition instead of auto-generation
Next Steps: Navigate to specific reference documents above based on your implementation needs. Start with getting-started.md for initial setup, then explore editors and organization features as needed.