Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[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
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Collapse]Property Grid
    Overview
   [Collapse]Getting Started
     Creating Property Definitions
     Managing Collection Properties
   [Expand]Property Definitions
    Property Attributes
    Property Categories
    Descriptions
    Expandability Customization
    Property Menu
   [Expand]Visual Elements
    Appearance Customization
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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.18.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?​​​​​​​