title: ItemsSource data type displayed in DataGrid
body: <p>I'm using a DataGrid inside a StackPanel inside a Grid which causes the GridView to be wider than its preferred size. All the columns are displayed correctly but after the last column the end of the ItemsSource data type name is displayed. Apparently its is drawn in the background and hidden by the columns in the normal case.</p>
  
  <p>I tried to add an empty column with MinWidth="0" and Width="*" but like that the horizontal scrollbar is not displayed if necessary.</p>
  
  <p>How do I hide the data type text?</p>
  
  <p><strong>XAML code:</strong></p>
  
  <pre><code>    &lt;Grid Margin="5,5,5,5"
        Grid.IsSharedSizeScope="True"&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition /&gt;
          &lt;ColumnDefinition Width="30" /&gt;
          &lt;ColumnDefinition /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;StackPanel Grid.Row="0"
                  Grid.Column="0"
                  Orientation="Vertical"&gt;
          &lt;DataGrid ItemsSource="{Binding BudgetPositions}"
                    IsSynchronizedWithCurrentItem="True"
                    AutoGenerateColumns="False"
                    GridLinesVisibility="None"
                    HeadersVisibility="Column"
                    CanUserAddRows="False"
                    CanUserDeleteRows="False"&gt;
              &lt;DataGrid.Resources&gt;
              &lt;/DataGrid.Resources&gt;
              &lt;DataGrid.Columns&gt;
                  &lt;!-- Budget group column --&gt;
                  &lt;DataGridTemplateColumn Header="Budget Group"
                                          Width="Auto"&gt;
                      &lt;DataGridTemplateColumn.CellTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;TextBlock DataContext="{Binding GroupName}"
                                         Text="{Binding Value}" /&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/DataGridTemplateColumn.CellTemplate&gt;
                  &lt;/DataGridTemplateColumn&gt;
  
                  &lt;!-- Budget position column --&gt;
                  &lt;DataGridTemplateColumn Header="Budget Position"
                                          Width="Auto"&gt;
                      &lt;DataGridTemplateColumn.CellTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;TextBlock DataContext="{Binding PositionName}"
                                         Text="{Binding Value}" /&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/DataGridTemplateColumn.CellTemplate&gt;
                  &lt;/DataGridTemplateColumn&gt;
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
          &lt;Button Content="Add budget position"
                  x:Name="addPositionButton"
                  Width="140"
                  Command="{Binding BudgetPositions.AddNewCommand}" /&gt;
      &lt;/StackPanel&gt;
      ...
  </code></pre>
  
  <p></p>
  
  <p>Here's a screenshot of the DataGrid:
  <a href="http://www.freeimagehosting.net/uploads/04e173120d.png" rel="nofollow noreferrer">The rightmost column shows the ItemsSource type name http://www.freeimagehosting.net/uploads/04e173120d.png</a></p>
  
  <p>Cheers AC</p>