HandyControls icon indicating copy to clipboard operation
HandyControls copied to clipboard

Why does the `SelectAll` button in `DataGrid` have a 6 bottom margin?

Open GF-Huang opened this issue 5 months ago • 4 comments

Describe the bug

https://github.com/ghost1372/HandyControls/blob/af92ec8ab41dec43dd7092ccc36638ac6738f79d/src/Shared/HandyControl_Shared/Themes/Styles/DataGrid.xaml#L69

It make the SelectAll button not align to the other column header text (higher then others).

Image

Steps to reproduce the bug

Just run the HandyControl demo.

Expected behavior

No response

Screenshots

No response

NuGet package version

HandyControl 3.6.0

IDE

Visual Studio 2022

Framework type

.NET 9.0

Windows version

Windows 11 (26100.4652)

Additional context

No response

GF-Huang avatar Jul 10 '25 06:07 GF-Huang

In my program, I used hc:DataGridAttach.ShowSelectAllButton="True", but the button did not appear.

CodingOctocat avatar Dec 06 '25 03:12 CodingOctocat

I remember having to set a xxxWidth property on the DataGrid for the SelectAll button to appear. I don't remember the full name of xxxWidth.

GF-Huang avatar Dec 06 '25 07:12 GF-Huang

I remember having to set a xxxWidth property on the DataGrid for the SelectAll button to appear. I don't remember the full name of xxxWidth.

RowHeaderWidth="60"

ghost1372 avatar Dec 06 '25 11:12 ghost1372

@ghost1372 RowHeaderWidth="60" It does work, but it will cause a column of blank space.

It seems to require a CheckBox.

<DataGrid.RowHeaderTemplate>
    <DataTemplate>
        <CheckBox IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}" />
    </DataTemplate>
</DataGrid.RowHeaderTemplate>
Image

CodingOctocat avatar Dec 07 '25 01:12 CodingOctocat