Click here to Skip to main content
15,921,841 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In WPF how to change the width of <code>DataGrid.ScrollBar?
Posted
Updated 22-Mar-11 23:34pm
v2

1 solution

You would need to make a custom Template for the DataGrid. In your custom template you need to create a ControlTemplate for the ScrollViewer, where you need to include a ScrollBar with x:Name="PART_VerticalScrollBar" and give it a width of whatever you like. Something like this:(only part of a template)

XML
<ScrollBar x:Name="PART_VerticalScrollBar" Width="100" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
 
Share this answer
 
Comments
Tarun.K.S 23-Mar-11 7:23am    
Exactly! 5d!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900