title: Blank row is not visible in DataGrid
body: <p>I am binding an <code>ObservableCollection</code> to a DataGrid, and I want to be able to add items in the observablecollection through the blank rows.  However, when the list is empty at run time, this blank row is not showing up.  I have looked up this problem, I have <code>CanUserAddRows=true</code>, I have <code>IsReadOnly=false</code>, and I have set the datagrid's datacontext to the observable collection, and I have an empty constructor and it is still not working.  Here is what I have so far:</p>
  
  <p>In XAML:</p>
  
  <pre><code>&lt;DataGrid AutoGenerateColumns="False" ItemsSource="{Binding Source={StaticResource CostCenterListViewSource}}" Name="costCenterListDataGrid" VerticalAlignment CanUserAddRows="True" CanUserDeleteRows="True" IsReadOnly="False"&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=Name, Mode=TwoWay}" Header="Cost Center" Width="102" /&gt;
          &lt;DataGridTextColumn x:Name="glCodeColumn" Binding="{Binding Path=GlCode, Mode=TwoWay}" Header="Gl Code" Width="80" /&gt;
          &lt;DataGridTextColumn x:Name="costCenterPercentageColumn" Binding="{Binding Path=CostCenterPercentage, Mode=TwoWay}" Header="%" Width="30" /&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>In my code behind I have this:</p>
  
  <pre><code>costCenterListDataGrid.DataContext = item.CostCenterList;
  //when "item" was instantiated, it also created a new instance: costCenterList = new ObservableCollection&lt;CostCenter&gt;();
  </code></pre>
  
  <p>and in the CostCenter class I have:</p>
  
  <pre><code>public CostCenter()
  {
  }
  
  public string Name
      {
          get { return name; }
          set
          {
              if (String.IsNullOrEmpty(Name) || !Name.Equals(value))
              {
                  name = value;
                  OnPropertyChanged("Name");
              }
          }
      }
  
      public string GlCode
      {
          get { return glCode; }
          set 
          {
              if (String.IsNullOrEmpty(GlCode) || !GlCode.Equals(value))
              {
                  glCode = value;
                  OnPropertyChanged("GlCode");
              }
          }
      }
  
      public double CostCenterPercentage
      {
          get { return cPercentage; }
          set
          {
              if (CostCenterPercentage != value)
              {
                  cPercentage = value;
                  OnPropertyChanged("CostCenterPercentage");
              }
          }
  
      }
  </code></pre>
  
  <p><strong>EDIT:  This is what I have in my Window.Resources</strong></p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;CollectionViewSource x:Key="jobItemViewSource1" d:DesignSource="{d:DesignInstance my:JobItem, CreateList=True}" /&gt;
      &lt;CollectionViewSource x:Key="jobItemNotesHistoryViewSource" Source="{Binding Path=NotesHistory, Source={StaticResource jobItemViewSource1}}" /&gt;
      &lt;CollectionViewSource x:Key="CostCenterListViewSource" Source="{Binding Path=CostCenterList, Source={StaticResource jobItemViewSource1}}" /&gt;
      &lt;CollectionViewSource x:Key="CostCenterListAfesViewSource" Source="{Binding Path=Afes, Source={StaticResource CostCenterListViewSource}}" /&gt;
  &lt;/Window.Resources&gt;
  </code></pre>