I have a WPF application that is meant to run on a touchscreen. Hence, all the buttons must be a bit bigger, so the user can click them by hitting the screen, rather than using the mouse. One of the views contains a data grid that is bound to an observable collection. Based on the search criteria entered, the collection may be populated with lots of records and it won't fit on the screen. The data grid shows the scroll bars, but they are narrow, regular size. Is there a way I can change the thickness of the scroll bars, so the user can scroll up and down or left and right with its finger?
Asked
Active
Viewed 713 times
1 Answers
0
I used this code to increase the size on a ScrollViewer scrollbars. You can use the same for a Datagrid.
Add the following Namespace:
xmlns:sys="clr-namespace:System;assembly=mscorlib"
And the following to your Datagrid:
<DataGrid Name="DGrid" Width="300" Height="150">
<DataGrid.Resources>
<sys:Double x:Key="{x:Static SystemParameters.VerticalScrollBarWidthKey}">30</sys:Double>
<sys:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarHeightKey}">30</sys:Double>
</DataGrid.Resources>
</DataGrid>

Insane
- 654
- 10
- 18