数据网格行边框问题 - 某些行中缺少边框

时间:2012-12-11 16:00:27

标签: datagrid

我有一个动态数据网格我的Silverlight应用程序。我设置了数据网格样式,行样式和单元格样式。加载时的数据网格隐藏某些行的边框。默认样式中的一切看起来都很好。我无法找到原因。请帮忙。

请注意:BasicColor是一些定义的颜色。

   <!--DataGridStyle : Sets the DataGrid Style : Selected Cell Background, Mouse Hover Background, etc-->
    <Style x:Key="DataGridStyle" TargetType="gridcontrol:DataGrid" >
        <Setter Property="RowBackground" Value="{StaticResource BasicColor1}" />
        <Setter Property="AlternatingRowBackground" Value="{StaticResource BasicColor1}" />
        <Setter Property="Background" Value="{StaticResource BasicColor6}"/>
        <Setter Property="HorizontalGridLinesBrush" Value="{StaticResource BasicColor9}"/>
        <Setter Property="VerticalGridLinesBrush" Value="{StaticResource BasicColor4}"/>
    </Style>


<!--DataGridCol : Sets the Style of the Content of the Cell in the Datagrid-->
        <Style x:Key="DataGridCellContentStyle" TargetType="sdk:DataGridCell" >
            <Setter Property="Foreground" Value="{StaticResource BasicColor6}"/>
            <Setter Property="FontSize" Value="11"/>
            <Setter Property="FontStretch" Value="SemiCondensed"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="Height" Value="Auto"/>
        </Style>


   <Style TargetType="gridcontrol:DataGridRow" x:Key="DataGridRowStyle">
            <Setter Property="IsTabStop" Value="False"/> 
            <Setter Property="BorderBrush" Value="Red"/>
            <Setter Property="BorderThickness" Value="2"/>![enter image description here][1]
            <Setter Property="Height" Value="20"/>
   </Style>

0 个答案:

没有答案