<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://xceed.com/CS/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'CellContentTemplate' and 'Grouping Header'</title><link>http://xceed.com/CS/search/SearchResults.aspx?o=DateDescending&amp;tag=CellContentTemplate,Grouping+Header&amp;orTags=0</link><description>Search results matching tags 'CellContentTemplate' and 'Grouping Header'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Debug Build: 61120.2)</generator><item><title>Applying the same resource to both CellContentTemplate and GroupValueTemplate</title><link>http://xceed.com/CS/forums/post/24849.aspx</link><pubDate>Thu, 12 Nov 2009 08:24:59 GMT</pubDate><guid isPermaLink="false">14592c03-f9d0-4f6b-b4cd-71e0e1b1f679:24849</guid><dc:creator>Marcin</dc:creator><description>&lt;p&gt;I'm working on quite big project which extensively uses Xceed datagrid. So far we have set CellContentTemplate to make it possible to map integer codes stored in transaction tables to human readable descriptions (also stored in database, in dictionary tables). See line below:&lt;br&gt;&lt;/p&gt;&lt;p style="margin-left:40px;"&gt;&amp;lt;xcdg:Column FieldName="Country" Title="Country" CellContentTemplate="{StaticResource CountryCellDataTemplate}"&amp;nbsp; /&amp;gt;&lt;/p&gt;&lt;p&gt;Now we got to the point we would like to have also GroupValueTemplate set to the same value the CellContentTemplate is. I realize the most straightforward way to go is to set it in XAML wherever needed, like below:&lt;br&gt;&lt;/p&gt;&lt;p style="margin-left:40px;"&gt;&amp;lt;xcdg:Column FieldName="Country" Title="Country" CellContentTemplate="{StaticResource CountryCellDataTemplate}"&amp;nbsp; GroupValueTemplate="{StaticResource CountryCellDataTemplate}" /&amp;gt;&lt;/p&gt;&lt;p&gt;However I wonder if it can be done by setting a style. I tried something similar on other controls (like, for example, Button) and it works, but I can't make it work in case of Xceed datagrid. Here is what I'm trying to do:&lt;br&gt;&lt;/p&gt;&lt;div style="margin-left:40px;"&gt;&amp;lt;Style TargetType="{x:Type xcdg:Column}"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Setter Property="GroupValueTemplate" Value="{Binding RelativeSource={RelativeSource Self}, Path=CellContentTemplate}" /&amp;gt;&lt;br&gt;&amp;lt;/Style&amp;gt;&lt;/div&gt;&lt;div style="margin-left:40px;"&gt;&amp;nbsp; &lt;br&gt;&lt;/div&gt;&lt;p&gt;I think it should work this way... Or maybe I'm missing something? I would really appreciate your help.&lt;/p&gt;&lt;p&gt;To stress how helpful it would be I will only say, that if it doesn't work, I will have to add GroupValueTemplate in over 1140 places... &lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;With kind regards,&lt;/p&gt;&lt;p&gt;Marcin &lt;/p&gt;</description></item></channel></rss>