first, what I am trying to do: I have a WPF datagrid with one column and x rows. I have a Style-Trigger that Sets the ScrollViewer.VerticalScrollBarVisibility
to Visible
as soon as IsMouseOver
is True
. Its working as expected, but the Problem is, the Column will be resized by the appereance of the scrollbar (scrollbar width 5 px). So i decided to set a padding to my grid that changes from 5 to 0 when the scrollbar is shown.
Its working all well, but if my Rows dont exceed the border of the datagrid, a grey disabled background is shown. I could set the ScrollViewer.VerticalScrollBarVisibility
to Auto
instead, then the background wont show up if there is enough space in my datagrid, but then the padding resizes the column (because there is no 5px scrollbar that is shown)
So i decided to stick with the Visible- instead of the Auto setting and try to make this disabled scrollbar background transparent. is this possible or is it posible to solve this problem with another workaround?
<Setter Property="Opacity" Value="0.4" />
. The only problem is the entire scrollbar, not just the background / scroll tracker, is transparent. – sab669