I have a two-columns grid layout that contains two custom controls. The two controls together make a table/datagrid. The reason I've split this table/datagrid into two chunks is that the second control (the one on the right) could be horizontally very large, so it needs to be wrapped in a ScrollViewer. The one on the left acts as a header and should be visible at all times, it can't be scrolled out of view. The two parts have a matching height.
The problem, as you can see bellow, is that the horizontal scrollbar of the scrollviewer pushes the second part up instead of taking its own space.
Mind you, the ScrollViewer's vertical scrollbar is not used as the height of the table is relatively small.
Here is how it should look:
What I've tried so far:
- I tried adding a row to the grid (both as
autoand*heights), and made the ScrollViewer span over it but to no avail. - I've set that row's height to match the scrollbar height which kind of worked but I see two huge issues with this approach:
- If the scrollbar is not needed (the second control is not so big horizontally), that row becomes an empty space used for nothing, sort of a like a margin which is undesirable, in my case anyway.
- It's not reliable as it relies on a hardcoded size of the scrollbar which we know can change from environment to environment and from theme to theme.



