C
C#2w ago
Dyda

✅ 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?
No description
No description
7 Replies
Buddy
Buddy2w ago
DataGrid should already come with a scroll.
Dyda
DydaOP2w ago
What if not? In my case when I'm resizing window i can't scroll items on list
Dyda
DydaOP2w ago
Here’s an example: when I minimize the window, I can't scroll, and some of the data is missing.
No description
No description
Buddy
Buddy2w ago
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
Dyda
DydaOP2w ago
I don't see anything suspicious. The DataGrid is nested inside a ScrollViewer.
No description
Dyda
DydaOP2w ago
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.
No description
No description
Dyda
DydaOP2w ago
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.

Did you find this page helpful?