WPF DataGrid列没有标题

时间:2010-02-24 21:02:40

标签: wpf

2 个答案:

答案 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的默认样式周围加上一个边距会导致这种情况。