title: WPF DataGrid not showing scrollbars and running out of visible area
body: <p>Like others I have a DataGrid that is not showing scrollbars. What I think is unique to my situation is that I do not see a StackPanel anywhere in the visual or logical tree. I am using WPF Inspector to view the trees. I have tried various suggestions to set the height and width of the containing Grid columns and rows with no success. I'm certain there is something I'm missing that is allowing the content to extend beyond the visible area but I cannot tell what it is yet. Any help would be appreciated. This application is a WPF Prism with MEF app and the DataGrid is within a UserControl which is in a Prism region. </p>
  
  <p>Shell Window XAML:</p>
  
  <pre><code>&lt;Window&gt;
    &lt;Grid x:Name="GridOuterShell"&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="Auto"/&gt;
          &lt;RowDefinition Height="*"/&gt;
          &lt;RowDefinition Height="Auto"/&gt;
      &lt;/Grid.RowDefinitions&gt;
  
      &lt;ribbon:Ribbon Grid.Row="0" &gt;
          ...
      &lt;/ribbon:Ribbon&gt;
  
      &lt;Grid x:Name="GridShellContent" Grid.Row="1"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition /&gt;
              &lt;RowDefinition Height="Auto" /&gt;
              &lt;RowDefinition /&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="350" MinWidth="300"/&gt;
              &lt;ColumnDefinition Width="Auto"/&gt;
              &lt;ColumnDefinition Width="*"/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
  
  
          &lt;local:RegionBorderControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="3" Margin="2,2,8,2" RegionName="{Binding MainRegionDisplayName}"
                                 Style="{DynamicResource RegionBorderControlStyle}"&gt;
          &lt;ContentControl prism:RegionManager.RegionName="MainRegion"
                          VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/&gt;
  
          &lt;/local:RegionBorderControl&gt;
  
  
          &lt;GridSplitter Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" HorizontalAlignment="Center" VerticalAlignment="Stretch"
                    Width="3" ShowsPreview="True" ResizeDirection="Columns" /&gt;
  
          &lt;local:RegionBorderControl Grid.Row="0" Grid.Column="2" RegionName="{Binding RightTopRegionDisplayName}"
                                 Style="{DynamicResource RegionBorderControlStyle}"&gt;
          &lt;ContentControl prism:RegionManager.RegionName="RightTopRegion"
                          VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/&gt;
  
          &lt;/local:RegionBorderControl&gt;
  
          &lt;GridSplitter Grid.Row="1" Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Center"
                    Height="3" ShowsPreview="true" ResizeDirection="Rows" ResizeBehavior="PreviousAndNext" Background="Silver"/&gt;
  
          &lt;local:RegionBorderControl Grid.Row="2" Grid.Column="2" RegionName="{Binding RightBottomRegionDisplayName}"
                                 Style="{DynamicResource RegionBorderControlStyle}"&gt;
              &lt;ContentControl prism:RegionManager.RegionName="RightBottomRegion"/&gt;
  
          &lt;/local:RegionBorderControl&gt;
  
      &lt;/Grid&gt;
  
      &lt;StatusBar Grid.Row="2"&gt;
          ...
      &lt;/StatusBar&gt;
  
    &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>UserControl XAML:</p>
  
  <pre><code>&lt;UserControl&gt;
  
  &lt;Grid x:Name="GridMain"&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto"/&gt;
              &lt;RowDefinition /&gt;
              &lt;RowDefinition Height="Auto"/&gt;
          &lt;/Grid.RowDefinitions&gt;
  
          &lt;DockPanel Grid.Row="0" LastChildFill="False" HorizontalAlignment="Stretch" Width="Auto" &gt;
              &lt;ToolBar x:Name="tbToolBar" DockPanel.Dock="Left" Background="{x:Null}"&gt;
                  ...
              &lt;/ToolBar&gt;
          &lt;/DockPanel&gt;
  
          &lt;DataGrid AutoGenerateColumns="False" Grid.Row="2" Name="DataGridList" ItemsSource="{Binding MyItems}" IsReadOnly="True" CanUserResizeRows="False" SelectionMode="Single" 
                      SelectedItem="{Binding Path=SelectedDataGridRecord, Mode=TwoWay}" Style="{StaticResource DataGridDefault}" &gt;
              &lt;DataGrid.Columns&gt;
                  ...
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
  
      &lt;/Grid&gt;
  </code></pre>
  
  <p></p>