2010-04-16 54 views
1

我的Datagrid是:Silverlight的DataGrid的风格

<Style x:Key="dgStyle" TargetType="data:DataGrid"> 
     <Setter Property="Background" Value="White"/> 
     <Setter Property="RowBackground" Value="#FFF6F6F6"/> 
     <Setter Property="Foreground" Value="#FF3A3B3B"/> 
     <Setter Property="FontFamily" Value="Verdana"/> 
     <Setter Property="FontSize" Value="13.333"/> 
    </Style> 

例外 - >无效的属性值数据:

<data:DataGrid x:Name="dgSearchResults" Style="{StaticResource dgStyle}" Grid.Row="1" ColumnHeaderStyle="{StaticResource dgHeaderStyle}" > 

我在App.xaml文件中定义的样式DataGrid的财产的TargetType 。 [行:61职位:43]

回答

1

你App.xaml中不包含下列命名空间别名: -

xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 
+0

真正有用的答案 – Ramakrishnan 2011-04-12 10:44:10