DataGrid unable to scroll to the last line

Themes, Shared, and Core Libraries for Avalonia Forum

Posted 3 months ago by MJ
Avatar

When displaying a large number of lines (e.g., 10 000) in a DataGrid it's not possible to scroll to the last line using the scroll wheel, scrolling stops at the penultimate line and the last line is not visible. Dragging the scroll bar with the pointer or using arrow keys works correctly, the issue only occurs when using the scroll wheel. Other prerequisite is that display scaling is enabled. Tested in Windows 10/11 with display scale of 125% and 150%.

Example:

App.axaml

<Application.Styles>
    <actipro:ModernTheme Includes="NativeDataGrid">
        <actipro:ModernTheme.Definition>
            <generation:ThemeDefinition
                BaseFontSize="12"
                UserInterfaceDensity="Compact" />
        </actipro:ModernTheme.Definition>
    </actipro:ModernTheme>
</Application.Styles>

MainWindow.axaml

<DataGrid Name="TestDataGrid" AutoGenerateColumns="True" />

MainWindow.axaml.cs

TestDataGrid.ItemsSource = Enumerable.Range(1, 10000);

Drag the scroll bar near the end and scroll the rest of the way using the scroll wheel and it won't be possible to scroll to the line 10 000. Line 9 999 will be the last visible line.

Comments (2)

Answer - Posted 3 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi MJ,

We aren't the authors of the Avalonia DataGrid control.  We just have an optional theme for it.  Thanks to your excellent reproduction steps, I did double check to verify that the issue can be observed even when using Avalonia's Fluent theme.  For issues with native controls that are unrelated to our themes, you'll need to post in the Avalonia GitHub repository and the team there will reply to you.


Actipro Software Support

Posted 3 months ago by MJ
Avatar

Hi,

Initially I wasn't able to reproduce the issue using Avalonia's Fluent theme, that's why I reported the issue here. After a bit of playing around I was able to reproduce it also using that theme. Thank you for your response and I'm sorry for bothering you.

Add Comment

Please log in to a validated account to post comments.