WPF Grid not showing scroll bars

In general, a ScrollViewer needs to be told that it is smaller than its content. So just adding a ScrollViewer to make a control scrollable is not always sufficient. The ScrollViewer knows that it is smaller if its enclosing control has a fixed or maximum size, or if itself has a fixed height or maximum height, as in

<ScrollViewer Height=500 HorizontalScrollBarVisibility="Visible">
...
</ScrollViewer>

, or if its Height (or MaxHeight) is bound to something appropriate.

The same thing goes for the horizontal scrollbar, you can set it to visible all you like, if the width of the ScrollViewer is not constrained, the ScrollViewer will just expand to the size of its content. If the scrollbar visibility then is "Auto", it will not show a scrollbar, and if it is "Visible", it will show a disabled one. (Note that the HorizontalScrollbarVisibility is "Disabled" by default.) To get a useful horizontal scrollbar, constrain the width of the ScrollViewer and set its HorizontalScrollbarVisibility to at least "Auto".


Grid does not support scrolling functionality. If you want to scroll something you need ScrollViewer control

<ScrollViewer HorizontalScrollBarVisibility="Visible">
   <Grid x:Name="MyGrid" HorizontalAlignment="Left" Height="535" VerticalAlignment="Top" Width="736" Margin="10,63,0,0">
      <Grid.Resources>
         <Style TargetType="{x:Type Panel}">
            <Setter Property="Margin" Value="0,0,0,6" />
         </Style>
      </Grid.Resources>
      <Grid.ColumnDefinitions>
         <ColumnDefinition/>
         <ColumnDefinition/>
         <ColumnDefinition/>
         <ColumnDefinition/>
         <ColumnDefinition/>
      </Grid.ColumnDefinitions>
   </Grid>        
</ScrollViewer>