title: WPF: How to bind a numeric property to DataGridTextColumn?
body: <p>I thought it should be a simple thing for WPF, but I can't make it work...
  I have an int property (Divisions) on my class and I want to bind it to a DataGrid column. </p>
  
  <pre><code>&lt;DataGrid AutoGenerateColumns="False"&gt;
      &lt;DataGrid.Columns&gt;
              &lt;DataGridTextColumn Header="Number of Divisions" Binding="{Binding Path=Divisions, StringFormat={}\{0:N0\}}" IsReadOnly="True"/&gt;                
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>However, it doesn't show up. 
  I also tried this code and it doesn't work for me either:</p>
  
  <pre><code>&lt;DataGrid AutoGenerateColumns="False"&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTemplateColumn Header="Divisions" IsReadOnly="True"&gt;
              &lt;DataGridTemplateColumn.CellTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBlock Text="{Binding Path=Divisions, StringFormat=C}" /&gt;
                  &lt;/DataTemplate&gt;
              &lt;/DataGridTemplateColumn.CellTemplate&gt;
          &lt;/DataGridTemplateColumn&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>For testing purpse, if I add a string property to this class to return string value of Divisions, it just works fine. So, what's wrong here?</p>