✅ Responsive ScrollViewer AvaloniaUI
Hi, I'm having trouble setting up a ScrollViewer in my project. I want it to be responsive for a DataGrid, but when I set the second row definition in the Grid to "*", the scroll doesn't work. It only works if I assign a fixed value, but that makes it non-responsive. How can I make it responsive while ensuring the scroll works properly?


7 Replies
DataGrid should already come with a scroll.
What if not? In my case when I'm resizing window i can't scroll items on list
Here’s an example: when I minimize the window, I can't scroll, and some of the data is missing.


press F12 on the running app (debug) and make sure nothing is outside the bounds
As far as I'm aware it's not permanently visible. It will only become visible if you hover the rightmost area
I don't see anything suspicious. The DataGrid is nested inside a ScrollViewer.

What I've noticed in the dev tools is that when I change the window size, the LargeChange property of the ScrollViewer (for the width) updates correctly. However, when I adjust the height, the LargeChange property for the height stays the same.


The height of the ScrollViewer in the dev tools is set to "None," which is why it's not working. My question is how to set up a responsive height that is bound to the window height.
Okay, I’m stupid, but it works well—only if I reload the view after resizing the window.