我的WPF DataGrid列没有与标题对齐。知道为什么吗?
http://picasaweb.google.com/lh/photo/CahvlINknhL5ykIW2zCfIw?feat=directlink
更多信息:
http://sweux.com/blogs/smoura/index.php/wpf/2009/04/27/wpf-toolkit-datagrid-part-ii-custom-styling/
答案 0 :(得分:1)
如果找到here,我使用该技术以编程方式生成Generic.xaml文件时弹出此问题!。
我没有调出默认的边距,但是当我将宽度设置为自动时,问题似乎已经消失了。
<!--<Button Command="SelectAll" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly=DataGrid, ResourceId=DataGridSelectAllButtonStyle}}" Width="Auto" Visibility="Visible" Focusable="False" />-->
<Button Command="SelectAll" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly=DataGrid, ResourceId=DataGridSelectAllButtonStyle}}" Width="5" Visibility="Visible" Focusable="False" />
答案 1 :(得分:0)
在Button的默认样式周围加上一个边距会导致这种情况。