1

我的 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>
4

0 回答 0