benruehl / adonis-ui

Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
https://benruehl.github.io/adonis-ui/
MIT License
1.69k stars 143 forks source link

Jittery sideways scrolling a datagrid with frozen column #160

Open gazle opened 3 years ago

gazle commented 3 years ago

Describe the bug When horizontally scrolling a DataGrid that has attribute FrozenColumnCount="1", the result is not smooth scrolling, the entire grid will shake a few pixels left and right during the scroll.

To Reproduce Make a WPF DataGrid with at least 1 frozen column like so:

<DataGrid Name="dataGrid" AutoGenerateColumns="False" CanUserResizeRows="False" FontSize="14"
    FrozenColumnCount="1" IsReadOnly="True" IsSynchronizedWithCurrentItem="True"
    ItemsSource="{Binding Machines}" RowHeaderWidth="0" SelectionMode="Single">
...
</DataGrid>

Have a source collection with a few properties to make the columns with and make a few thousand items in the ObservableCollection.

Make the Window narrow enough so you get a horizontal scroll bar in the DataGrid, proceed to scroll it left and right.

Expected behavior Smooth scrolling, not jittery.

Screenshots

Additional context

gazle commented 3 years ago

Actually This doesn't seem to be related to the FrozenColumnCount at all but the RowHeaderWidth="0" property. Any other value than zero and it scrolls fine but with these styles the Header row Button oscillates its Width while you scroll causing this behaviour.

In Snoop you can see an error on that Button's Width property, 'Error in Parent Template'.