Posted 15 years ago
by Mick
I'm trying to get a property in the property grid to display the value of its sub property as its header.
My structure looks something like this---
"A" is the class that I want to use for the property editor. It exposes property D, which is a property with sub properties. I want to use "E" (i.e. A->D->E) as the header for my expandable property editor.
I have implemented everything to make it work the way I want in a PropertyEditor DataTemplate using this binding:
"{Binding Value.E, RelativeSource={RelativeSource AncestorType={x:Type propgrid:IPropertyDataAccessor}}, Mode=TwoWay}"
Everything works as expected, but when I select multiple items for the property grid, this binding is ignored and the header displayed for my "D" class in the property grid is blank.
I have recreated the issue I am experiencing in a small sample project if clarification is needed.
Is there something I'm overlooking?
Thank you,
Mick
My structure looks something like this
public class A
{
public int B { get; set; }
public string C { get; set; }
public CustomProperty D { get; set; }
}
public class CustomProperty
{
public int E { get; set; }
public string { get; set; }
}
"A" is the class that I want to use for the property editor. It exposes property D, which is a property with sub properties. I want to use "E" (i.e. A->D->E) as the header for my expandable property editor.
I have implemented everything to make it work the way I want in a PropertyEditor DataTemplate using this binding:
"{Binding Value.E, RelativeSource={RelativeSource AncestorType={x:Type propgrid:IPropertyDataAccessor}}, Mode=TwoWay}"
Everything works as expected, but when I select multiple items for the property grid, this binding is ignored and the header displayed for my "D" class in the property grid is blank.
I have recreated the issue I am experiencing in a small sample project if clarification is needed.
Is there something I'm overlooking?
Thank you,
Mick