Custom SummaryTemplate

Grids for WPF Forum

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">
<ColumnDefinition Width="*"></ColumnDefinition>
Text="{Binding Path=Description, RelativeSource={RelativeSource AncestorType={x:Type propgrid:IPropertyDataAccessor}}}"

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?

Comments (1)

Posted 15 years ago by United Biosource - United Biosource
Nevermind - found the sample: Solution is

<TextBlock Grid.Column="0" FontWeight="Bold"
Text="{Binding Description}" Margin="0,0,3,0"
HorizontalAlignment="Left" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap" />
The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.