title: Horizontal Scrollbar not appearing in DataGrid
body: <p>My DataGrid appears with Data outside the visual scope. I have looked into several similar questions on StackOverflow but none of them seemed to solve my problem. I am not able to figure out as to what am I doing wrong. This is what my xaml looks like:</p>
  
  <pre><code>&lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="50"/&gt;
          &lt;RowDefinition Height="*"/&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="*"/&gt;
      &lt;/Grid.ColumnDefinitions&gt;        
      &lt;TextBlock HorizontalAlignment="Left" Foreground="{DynamicResource TitleFontColor}" 
       TextWrapping="Wrap" Text="{Binding WindowTitle}" VerticalAlignment="Center" 
       Margin="10,10,0,10" FontSize="18.667" FontFamily="Segoe UI" /&gt;
      &lt;Border  Background="{DynamicResource pnlworkarea}" 
        Grid.Row="1" CornerRadius="2" BorderThickness="1"&gt;
      &lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="65"/&gt;
              &lt;RowDefinition Height="Auto" /&gt;
              &lt;RowDefinition Height="*"/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Border BorderThickness="1" 
           Background="{DynamicResource Brush_HeaderNew}" 
           BorderBrush="{DynamicResource pnlworkareastroke}" 
           CornerRadius="2" Margin="5"&gt;
          &lt;Grid Margin="0"&gt;
                 &lt;ListBox ItemsSource="{Binding ViewMenuItems}" SelectedItem="{Binding Viewselected}" 
                  VerticalAlignment="Center" Style="{DynamicResource Content_Header_ListBoxStyle}" 
          ItemTemplate="{DynamicResource Header_DataTemplate}" 
          ItemContainerStyle="{DynamicResource ContentHeader_ListBoxItemStyle}"               
          ItemsPanel="{DynamicResource Header_ItemsPanelTemplate}" HorizontalAlignment="Left"/&gt;                                   
      &lt;/Grid&gt;
      &lt;/Border&gt;
      &lt;Grid Grid.Row="1" Margin="5"&gt;
              &lt;StackPanel HorizontalAlignment="Left" Orientation="Horizontal" VerticalAlignment="Top" Margin="10,0,0,0"&gt;
                       &lt;ContentControl Focusable="False" Content="ContentControl"  
          Background="{DynamicResource Brush_VectorIcon}" 
         Template="{DynamicResource vector_Summary}" 
         Height="16" Margin="0,5,0,0"/&gt;
          &lt;TextBlock TextWrapping="Wrap" Text="{Binding SearchDisplayMessage}" Margin="5,3,0,0" VerticalAlignment="Center"/&gt;
              &lt;/StackPanel&gt;
          &lt;/Grid&gt;
          &lt;Grid Grid.Row="2" Margin="5"&gt;
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition Height="Auto"/&gt;
                  &lt;RowDefinition Height="*"/&gt;
              &lt;/Grid.RowDefinitions&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="*"/&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;DataGrid  x:Name="dataGrid"
                      commands:ControlEvents.GridViewSelectionChangedEventCommand="{Binding SelectionItemsChangeCommand}"
                      SelectionMode="Single"
                      AutoGenerateColumns="True"                      
                      Margin="0,5" Grid.Row="1" IsReadOnly="True"
                      ItemsSource="{Binding GridItem, Mode=TwoWay}"  SelectedItem="{Binding SelectedItem}"
                      AlternatingRowBackground="#FFF5F4F8" Background="White" Grid.ColumnSpan="2"
                      ScrollViewer.CanContentScroll="True" 
                      ScrollViewer.HorizontalScrollBarVisibility="Auto" 
                      ScrollViewer.VerticalScrollBarVisibility="Auto"&gt;
                      &lt;i:Interaction.Behaviors&gt;
                          &lt;Behaviors:SelectorDoubleClickCommandBehavior Command="{Binding GridDoubleclickcommand}"/&gt;
                      &lt;/i:Interaction.Behaviors&gt;
  
                  &lt;/DataGrid&gt;
              &lt;/Grid&gt;
  
          &lt;/Grid&gt;
  
      &lt;/Border&gt;
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p>Just to add that the DataGrid here is not the actual DataGrid I am using. My Custom DataGrid is derived from DataGrid. But I have tried this with the normal DataGrid as well but doesn't seem to work either.</p>