Datagrid标题分隔符未显示 [英] Datagrid header Separators are not showing
本文介绍了Datagrid标题分隔符未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
请告诉我如何使标题分隔符可见。我尝试从谷歌的东西,但仍然没有显示......
谢谢
Hi all
Please tell me how to make the header Separators visible.i tried things from google but still its not showing...
Thank you
推荐答案
嗨。试试这个:
Hi.Try this one :
<Window.Resources>
<Style TargetType="{x:Type DataGridColumnHeader}" x:Key="columnHeaderStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
<Border BorderBrush="Black" BorderThickness="1 " Margin="1 0" Background="LightGray">
<ContentPresenter Content="{TemplateBinding Content}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<DataGrid x:Name="MainDataGrid" ColumnHeaderStyle="{StaticResource columnHeaderStyle}">
</DataGrid>
</Grid>
我希望这对你有帮助。
祝你好运
I hope this help you.
Good luck
这篇关于Datagrid标题分隔符未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文