2
我想影响到在Silverlight 4我有以下的风格一个DataGrid背景图案:Silverlight 4的DataGrid列标题样式
<Style x:Key="DashboardGridHeaderStyle"
TargetType="primitives:DataGridColumnHeader">
<Setter Property="FontSize"
Value="14" />
<Setter Property="FontWeight"
Value="Bold" />
<Setter Property="Foreground"
Value="{StaticResource xrxGray_I}" />
<Setter Property="Background"
Value="{StaticResource xrxGray_B}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid Height="50" Width="100">
<TextBlock Text="{TemplateBinding Header}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
当它被应用这导致异常。这是由Template setter造成的。有谁知道如何更改列标题的背景(我想要一个纯色而不是默认渐变)?
感谢您的任何帮助。
这奏效了,但是,我需要做的另一个变化是改变“文本=” {TemplateBinding头}“”to“Text =”{TemplateBinding Content}“”感谢您的帮助。 – Sako73 2010-09-28 19:09:23