[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Collapse]Property Grid
   [Collapse]Getting Started
     Creating Property Definitions
     Managing Collection Properties
   [Expand]Property Definitions
    Property Attributes
    Property Categories
    Expandability Customization
    Property Menu
   [Expand]Visual Elements
    Appearance Customization
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Creating Property Definitions

The WPF Property Grid control uses Property Definitions to define how and which properties are displayed.

This document demonstrates how to bind the WPF Property Grid control to data and create property definitions.

Perform the following steps.

Expanded Step 1 — Create a Property Grid

Add a PropertyGridControl component to the project.

To do this, open the Toolbox in Visual Studio, locate the DX.19.1: Data tab, choose the PropertyGridControl Toolbox item, and drop it onto the window.

Right-click the Property Grid and select Layout | Reset All to fill the entire window.

Expanded Step 2 — Create a Data Object

Create a data object and set it as the DataContext.

Expanded Step 3 — Bind the Property Grid to the Data Object

Use the property grid's PropertyGridControl.SelectedObject property to bind it to data.

Expanded Step 4 — Create Property Definitions

Add property definitions to the property grid. Set the PropertyGridControl.ShowProperties property to ShowPropertiesMode.WithPropertyDefinitions, to hide the properties that do not have definitions.

Run the application to see the result.

Is this topic helpful?​​​​​​​