title: wpf DataGrid of UserControls
body: <p>I am trying to have a DataGrid that shows a user controls in each cell of it's rows. highliting that the DataGrid have to be dynamic because columns count is dynamic for each case of use.</p>
  
  <p>In my xaml code (XAML) i have this as a declaration of the DataGrid :</p>
  
  <pre><code>&lt;Grid Grid.Column="1" Margin="0,10,0,0"&gt;
        &lt;DataGrid AutoGenerateColumns="False" x:Name="planningTable" FrozenColumnCount="1"/&gt; 
  &lt;/Grid&gt;
  </code></pre>
  
  <p>My user controle look like this (the UserControl is already done and it works perfectly):
  <img src="https://i.stack.imgur.com/M0tAU.jpg" alt="enter image description here"></p>
  
  <p>As a result of the DataGrid i want to have this UserControl in each Cell of the DataGrid
  it means that DataGrid Rows have to show this UserControl in each Cell.
  i've searched a lot for this trick but seems that DataGrid can't host a UserControl in cells.</p>
  
  <p>I want to have the C# code that do this, please no XAML code because it is all dynamic !!</p>