title: WPF DataGrid formatting cell to thousand separators
body: <p>I have <code>DataGrid</code> view in my WPF application which loads data of any given table from any given database. Now I want to convert all numeric values of the table content into thousand separators.</p>
  
  <pre><code> &lt;DataGrid  BorderBrush="Black" Background="White" Margin="10,0,10,10" FontSize="18" BorderThickness="1,0,1,1" RowHeaderWidth="0" x:Name="preview" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeColumns="False" IsTextSearchEnabled="True" IsTextSearchCaseSensitive="False" IsReadOnly="True" CanUserSortColumns="False" FontFamily="Arial" &gt;
      &lt;DataGrid.Resources&gt;
          &lt;Style TargetType="{x:Type ContentControl}"&gt;
              &lt;Setter Property="ContentStringFormat" Value="{Binding StringFormat={}{0:N}}"/&gt;
          &lt;/Style&gt;
      &lt;/DataGrid.Resources&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>But this is not affecting. What is the right way to achieve it?</p>