PropertyGrid Improvements and Custom Property Editors

by Avatar Bill Henning (Actipro)
Thursday, October 23, 2014 at 12:02pm

PostBannerWPFControlsDevNotes

Our WPF PropertyGrid control is an extremely powerful way to edit the properties of any object.

Custom Property Editor Sample

While a lot of PropertyGrid usage is for basic properties such as numbers, strings, dates, etc., properties can be of any custom Type as well.  In our most recent release of the WPF controls, we created a new custom property editor sample that shows how to easily add a custom property editor for a certain Type.

PropertyGridCustomEditor

The screenshot above shows how a custom enumeration named OnOffAuto was created.  The object being edited in the PropertyGrid has several properties that are of that type.  We defined in XAML a custom template that uses our HorizontalListBox control to allow for easy selection of the options.

In the case of the Security Alarm property, we made a further customized property editor template that only shows two of the options instead of all three.  This specialized template is configured to only apply to that one specific property.

While this sample shows how to make a custom property editor for an enumeration type, the same concepts can be applied to any custom type.

Other Recent PropertyGrid Improvements

In recent builds, we have further improved the editing experience when using PropertyGrid.  We added built-in property editors for font-related properties.  We added support so that double-clicking a property name will cycle through any standard value options that the property has.  In the event that the property doesn't support standard values, double-clicking the property name will attempt to focus the related editor instead and select all text if possible.

Summary

Download the latest build of our WPF controls to see this new sample and obtain the latest editing features.

TaskDownload TaskLiveDemo TaskBuyNow

Tags: wpf, grids

Actipro's WPF Controls

Over 100 UI controls for building beautiful Windows Presentation Foundation desktop apps.

Learn More

Over 100 UI controls for building beautiful Windows Presentation Foundation desktop apps.

Includes editors, docking windows, MDI, property grids, charts, tree controls, ribbons, gauges, themes, and much more.

Learn More Download Free Trial

Add Comment

Please log in to a validated account to post comments.