This project has moved. For the latest updates, please go here.

PropertyGrid ExpandableObject. How to make expanded by default?

Aug 7, 2013 at 5:44 PM
Edited Aug 7, 2013 at 5:45 PM
How to make ExpandableObject property expanded by default? Is it possible?

Also is it possible (using custom editors I think) to bind data from ExpandableObject to the expandable property itself.

So like this:
Image
Developer
Aug 8, 2013 at 2:49 PM
1) ExpandableObject property expanded by default : Issue https://wpftoolkit.codeplex.com/workitem/20054 has been created.

2) Bind data from ExpandableObject to the expandable property itself : You can have a
public override string ToString()
    {
      return FirstName + " " + LastName;
    }
in your object. Please have a look at the "PropertyGrid Using Attributes" sample. code file is "Xceed.Wpf.Toolkit.LiveExplorer\Samples\PropertyGrid\Views\PropertyGridAttributesView.xaml.cs".
Aug 11, 2013 at 8:00 PM
ToString() works, but it doesn't updates ExpandleObject property text when I change corresponding properties. So if I change "Doe" to "Smith" it still remains John Doe in the ExpandableObject property.
Aug 22, 2013 at 2:21 PM
I have the same problem. The property text of the ExpandleObject doesn't update after change a child property.
Nov 3, 2013 at 2:59 PM
Bump.
I am also facing this issue, anyone found a solution?
Developer
Nov 4, 2013 at 1:29 PM
Hi,

Concerning "The property text of the ExpandleObject doesn't update after change a child property. "

The modification of a propertyItem, which is a children of an expandable propertyItem, won't update the parent propertyItem. This is because you may use the "ToString()" method on the expandable PropertyItem to display some child properties of the expandable PropertyItem. But it is not always the case. Someone could display something else for this expandable PropertyItem.

If you want to update the display of the expandable PropertyItem, you need to give it a DataTemplate, which binds to it children PropertyItems. To do this, you need to implement an EditorTemplateDefinition for the specific properties (or types of properties).

So the ToString() method and the Editor attribute shouldn't be used. Also, the properties that are modified should raise an event change, or be Dependency Properties.
Nov 9, 2013 at 10:33 AM
Thanks, that was exactly what I was looking for!