title: WPF DataGrid Column TextWrapping Programmatically
body: <p>Basically what I'm trying to achieve is to have only the second column of my DataGrid to enable text wrapping instead of cutting it when there's no more space.</p>
  
  <p>My problem is that the DataGrid is empty in the xaml code and I generate it from a class programmatically.</p>
  
  <p>Xaml of the DataGrid is this: </p>
  
  <pre><code>&lt;DockPanel Grid.Row="1"&gt;
      &lt;DataGrid Name="dg_Misc" Margin="2" Background="#FF212121" SelectionUnit="Cell" VerticalGridLinesBrush="Black" GridLinesVisibility="Vertical"/&gt;
  &lt;/DockPanel&gt;
  </code></pre>
  
  <p>While the c# with which I generate the DataGrid is this:</p>
  
  <pre><code>Oggetto oggetto = new Oggetto();
  Oggetti.Add( new Oggetto() { } );
  
  dg_Misc.ItemsSource = Oggetti;
  dg_Misc.Items.Refresh();
  </code></pre>
  
  <p>In the class Oggetto I have two strings, Name and Description and they become two headers for the columns when the DataGrid is generated, I want the cells of the column Description to enable text wrapping.</p>