Posted 15 years ago
by United Biosource
-
United Biosource
I'd like the [Description] attribute of each property to show up in the summary area.
I tried this:
<DataTemplate x:Key="PropertySummaryTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
Margin="3"
Text="{Binding Path=Description, RelativeSource={RelativeSource AncestorType={x:Type propgrid:IPropertyDataAccessor}}}"
/>
</Grid>
</DataTemplate>
but I get this error when I select a property grid item:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='ActiproSoftware.Windows.Controls.PropertyGrid.Primitives.IPropertyDataAccessor', AncestorLevel='1''. BindingExpression:Path=Description; DataItem=null; target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
Any clues how to do this?
I tried this:
<DataTemplate x:Key="PropertySummaryTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
Margin="3"
Text="{Binding Path=Description, RelativeSource={RelativeSource AncestorType={x:Type propgrid:IPropertyDataAccessor}}}"
/>
</Grid>
</DataTemplate>
but I get this error when I select a property grid item:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='ActiproSoftware.Windows.Controls.PropertyGrid.Primitives.IPropertyDataAccessor', AncestorLevel='1''. BindingExpression:Path=Description; DataItem=null; target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
Any clues how to do this?