我正在尝试设置我的第一个WPF ListView/GridView,并且无法设置列标题的样式.我目前有3个问题.以下是GridView的视图:
替代文字http://img195.imageshack.us/img195/3245/wpfgridview.png
我想删除分隔列标题的小白色垂直边框.
我想删除MouseOver效果.此屏幕截图将鼠标悬停在第3列上,将背景变为白色.
如何在不将其拧紧的情况下覆盖单个列上的水平对齐?
这就是代码的样子:
<Style x:Key="GrayHeader" TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0.0" Color="#373638" />
<GradientStop Offset="1.0" Color="#57595B" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="White" />
<Setter Property="Padding" Value="5, 5" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
<ListView ItemsSource="{Binding Source={StaticResource
EmployeeInfoDataSource}}"
Margin="0,20,0,20">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}" >
<Setter Property="Height" Value="24" />
<Setter Property="Background" Value="#7BB3DC" />
<Setter Property="Foreground" Value="#000000" />
<Setter Property="FontSize" Value="12" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="BorderThickness" Value="1" /> …Run Code Online (Sandbox Code Playgroud)