How can I toggle the visibility of a DataGrid scrollbar on the IsMouseOver property of DataGrid?
I want to make the scrollbar visible when the mouse hovers over the DataGrid and invisible when the mouse goes out of the DataGrid. A XAML example would be appreciated.
I would apply a new style, something like this:
<Style x:Key="dataGridStyle" TargetType={x:Type DataGrid}>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
</Trigger>
</Style.Triggers>
</Style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With