Grids for WPF Forum

Posted 9 years ago by Amos Wittenberg
Version: 9.2.0515
I want to show a sample text in the Summary area with FontFamily and FontSize bound to those properties on my object. I am definuing the PropertyGridPropertyItems in xaml, i.e. not using SelectedObject.
I try to set the SummaryTemplateSelector to a StaticResource containing my DataTemplateSelector which returns a DataTemplate with my sample text and athe appropriate bindings if the item is either the FontFamily or the FontSize property, otherwise I return null, the idea being that I will then get the default Summray, i.e. property name + description.
I get the error message:
System.Windows.Data Error: 24 : Both 'ContentTemplate' and 'ContentTemplateSelector' are set; 'ContentTemplateSelector' will be ignored. ContentPresenter:'ContentPresenter' (Name='')

I do not understand this. I am not setting a ContentTemplate anywhere...

Can someone shed light?

Amos W

Comments (2)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Amos,

The default Style for the PropertyGrid sets the SummaryTemplate property, to give a default look/feel. So you'd need to clear this value to use SummaryTemplateSelector. Add something like SummaryTemplate="{x:Null}".

We've marked down a TODO item to workaround this automatically in the PropertyGrid.

Actipro Software Support

Posted 9 years ago by Amos Wittenberg
Dear Actipro Software Support:

I had the feeling it was something lime that but did not hit on the obvious workaround of nulling it out. I am pretty new to WPF and scaling Mount Learning Curve ;-)

Thanks for helping out.

Amos W
The latest build of this product (v2018.1 build 0675) was released 15 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.