WPF Datagrid 控制 第一行和第一列之间的空白
标签:复制 bar blog http title tst ring def off
原文:WPF Datagrid 控制 第一行和第一列之间的空白
这个位置就是 这里
我们更改 DataGridControltemplate 模板
看树形结构 里面是一个BUtton
功能是全选 能找到了 那就直接改掉就可以
-
"DataGridControlTemplate1" TargetType="{x:Type DataGrid}">
-
"{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
-
"DG_ScrollViewer" Focusable="False">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
"HeadersVisibility" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type DataGrid}}">
-
-
-
-
-
-
-
"PART_ColumnHeadersPresenter" Grid.Column="1">
-
-
"HeadersVisibility" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type DataGrid}}">
-
-
-
-
-
-
-
"PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" Grid.ColumnSpan="2" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Grid.Row="1"/>
-
"PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
-
-
-
"{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type DataGrid}}}"/>
-
-
-
"PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
-
-
-
-
-
"{TemplateBinding SnapsToDevicePixels}"/>
-
-
-
改这个就可以
-
-
-
"HeadersVisibility" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type DataGrid}}">
-
-
-
-
-
-
WPF Datagrid 控制 第一行和第一列之间的空白
标签:复制 bar blog http title tst ring def off
原文地址:https://www.cnblogs.com/lonelyxmas/p/12075413.html
评论