• Products
  • Download
  • Purchase
  • Support
  • Company
Actipro Software company logo
Twitter Follow Actipro RSS Subscribe (RSS Feed)

The Actipro Blog

Tag Cloud

  • blog
  • docking
  • editors
  • intelliprompt
  • micro charts
  • navigation
  • propertygrid
  • ribbon
  • shared library
  • silverlight
  • syntaxeditor
  • themes
  • views
  • web site
  • winforms
  • winrt
  • wpf

Latest Twitter News

May 14, 2012 at 2:50 PM
IntelliPrompt code snippet features have been added to our VS-like code editor control for #WPF and #Silverlight. http://t.co/1IchOJrr

May 10, 2012 at 9:40 PM
Our new Micro Charts control products for #WPF and #Silverlight are out now. Come build some dashboards with them! http://t.co/EEERvff0

May 7, 2012 at 6:47 AM
Today we look at bar charts, for our upcoming #WPF, #Silverlight, and #WinRT Micro Charts product. http://t.co/gxHuPS6B

May 4, 2012 at 6:25 AM
See a gallery of micro area charts in our upcoming release for #WPF, #Silverlight, and #WinRT. http://t.co/qDXGwW8B

May 3, 2012 at 6:32 AM
See a variety of line charts that are easy to make with our upcoming #WPF, #Silverlight, #WinRT Micro Charts product. http://t.co/mbkX6tJd

Twitter Follow us on Twitter

Month List

  • 2012
    • May (9)
    • April (6)
    • March (11)
    • February (11)
    • January (2)
  • 2011
    • December (2)
    • November (7)
    • October (2)
    • September (1)
    • August (5)
    • July (3)
    • June (6)
    • May (5)
    • April (8)
    • March (4)
    • February (5)
    • January (9)
  • 2010
    • December (9)
    • November (10)
    • October (4)
    • September (8)
    • August (12)
    • July (9)
    • June (7)
    • May (6)
    • April (7)
    • March (6)
    • February (6)
    • January (4)
  • 2009
    • December (2)
    • November (2)
    • October (12)
    • September (3)
    • August (11)
    • July (10)
    • June (6)
    • May (3)
    • April (7)
    • March (6)
    • February (8)
    • January (10)
  • 2008
    • December (10)
    • November (2)
    • October (3)
    • September (5)
    • August (5)
    • July (8)
    • June (4)
    • May (4)
    • April (10)
    • March (8)
    • February (1)
    • January (2)

Category List

  • RSS feed for ActiproActipro (321)
  • RSS feed for Blog SummaryBlog Summary (15)
  • RSS feed for GeneralGeneral (43)
  • RSS feed for In developmentIn development (164)
  • RSS feed for New featuresNew features (155)
  • RSS feed for New productNew product (38)
  • RSS feed for PromotionPromotion (2)
  • RSS feed for SilverlightSilverlight (90)
  • RSS feed for Tips and tricksTips and tricks (4)
  • RSS feed for Visual Studio 2008Visual Studio 2008 (2)
  • RSS feed for Windows FormsWindows Forms (22)
  • RSS feed for Windows VistaWindows Vista (10)
  • RSS feed for WinRTWinRT (9)
  • RSS feed for WPFWPF (257)
  • RSS feed for XAMLXAML (23)

About Us

Actipro Software is a leading provider of .NET user interface controls for the WPF, Silverlight, and WinForms frameworks, and is most well-known for their SyntaxEditor syntax-highlighting code editor control.

Please take some time to learn more about us and our product offerings.

Upcoming PropertyGrid for WPF enhancements: events and collection editing

April 8, 2010 at 2:36 AM
by Bill Henning (Actipro)

We've made two major enhancements to our PropertyGrid for WPF control that have been highly requested by our customers, which include property change events and better collection editing support.  These new features will roll out in the upcoming WPF Studio 2010.1 release.

Property change events

We've added two new bubbling routed events to the PropertyGrid called PropertyChanging and PropertyChanged. These events are fired before and after a property's value is changed via the PropertyGrid, respectively. The event arguments include the IPropertyDataAccessor that is being set, which can be used to access a variety of information about the underlying property (i.e. type, name, value, etc.). In addition, the raw value that is being assigned or was assigned is included in the event arguments. The value is considered "raw" because it may ultimately be converted by the TypeConverter associated with the property.

These events allow you to better track changes made through the PropertyGrid, including capturing undo/redo related information.

Collection support

In previous versions of the PropertyGrid, collections were presented using the associated TypeConverter. The TypeConverter determines whether a property is expandable and how it is converted to other types, such as a string when displayed in a TextBox/TextBlock. The .NET runtime includes two built-in type converters used with collections. The first is CollectionConverter, which does not allow expansion. This converter is used intrinsically by types that implement ICollection, which includes List<T> and Dictionary<TKey, TValue>. The second built-in type converter is ArrayConverter, which does allow expansion. This converter is used by Array objects, which includes types like string[] or int[].

So out of the box, the PropertyGrid would only allow the expansion of arrays as seen below.

PropertyGridCollectionDisplayModeDefault 
Default display mode of an array, a dictionary, a list, and an observable collection in a PropertyGrid

In the 2010.1 release, the PropertyGrid will continue to default to the behavior described above. But using the new CollectionDisplayMode property you can quickly change how collections are displayed. Collections are defined as types that implement ICollection/ICollection<T>, IList/IList<T>, or IDictionary/IDictionary<TKey,TValue>. 

Expandability

The CollectionDisplayMode.Expandable setting can be used to make all collections expandable. To perform this magic, we leverage a custom type converter that handles collections better than ones built into .NET.

PropertyGridCollectionDisplayModeExpandable 
Expandable display mode of an array, a dictionary, a list, and an observable collection in a PropertyGrid

Inline editing

The CollectionDisplayMode.EditableInline setting can be used to display inline editing buttons. These buttons can be used to add or remove items from the associated collection. The PropertyGrid is smart enough to show or hide these buttons based on whether the collection is read-only or of a fixed size. In addition, it determines whether it can instantiate an instance of the "element type" of the associated collection. For example, if you have a list of MyClass objects and MyClass does not have a default constructor, then the add button will not be visible.

PropertyGridCollectionDisplayModeEditableInline 
EditableInline display mode of an array, a dictionary, a list, and an observable collection in a PropertyGrid

Customization

Of course, you can always customize this behavior. You can extend our collection type converter and customize how and when items are added or removed. You could specify that the first 2 items in a list should be read-only and cannot be removed, or manually construct items to be added to a list.

Add/remove events

In addition, to the hooks described above we offer four new bubbling events on the PropertyGrid control. The PropertyChildAdding/PropertyChildAdded events are fired before and after a child item is added to a collection. As with the property events described above, you have access to the IPropertyDataAccessor associated with the collection, as well as the item (being) added. The PropertyChildAdding can be used to cancel the operation or update/modify the item being added, maybe using user input collected from a dialog.

Conversely, the PropertyChildRemoving/PropertyChildRemoved events are fired before and after a child is removed from a collection. Again, you have access to the IPropertyDataAccessor associated with the collection and the IPropertyDataAccessor associated with the item being removed. PropertyChildRemoving also allows you to cancel the removal operation.

Summary

We hope everyone likes the new features and finds them useful.  They open up new usage scenarios for the product.  Again, the new features will be available in the upcoming WPF Studio 2010.1 release.

Tags: wpf, propertygrid
Filed under: Actipro, In development, New features, WPF
Submit to DotNetKicks...
Permalink | Comments (2)

Related posts

PropertyGrid for WPF released as part of WPF Studio v4.5We're very happy to have just released PropertyGrid for WPF, a control we've been working on for sev...Themes for WPF Part 1 - Native WPF Control Themes In prior blog posts, we’ve detailed some of the great new features coming to the WPF SyntaxEditor ...WPF Studio integrates with and adds features to the official Microsoft WPF DataGridIn the most recent WPF Studio 2009.1 builds, we've integrated with and enhanced Microsoft's open sou...

Comments

April 27, 2010 at 15:54  

pingback

Pingback from topsy.com

Twitter Trackbacks for
        
        Upcoming PropertyGrid for WPF enhancements: events and collection editing
        [actiprosoftware.com]
        on Topsy.com

topsy.com

July 1, 2010 at 01:58  

trackback

Actipro Blog 2010 Q2 posting summary

Actipro Blog 2010 Q2 posting summary

The Actipro Blog - WPF and WinForms Development

Comments are closed
Copyright © 1999-2012 Actipro Software LLC. All rights reserved.
Home Actipro Software | Products | Download | Contact Us