Skip to content

Datagrid header 多余的margin问题 #1809

Description

@jinlife

Describe the bug

DataGrid的Template里面的两个Margin硬编码有问题。DataGridBaseStyle和DataGrid.Small都受这个影响。

Steps to reproduce the bug

给header换个颜色就能重现了。
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="Background" Value="Blue"
</Style>
</DataGrid.ColumnHeaderStyle>

下面这两个Margin="0,0,0,6"会让header下面出现gap,当Header的背景色都是灰色的时候看不出来,但是换了颜色后,就很明显了。第一行和Header之间有个灰色的gap。
<hc:SimplePanel Margin="0,0,0,6" ...
<DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Margin="0,0,0,6" ..

Image

Expected behavior

换header颜色时,下面不要有灰色gap

Screenshots

No response

NuGet package version

None

IDE

No response

Framework type

No response

Windows version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions