title: DataGrid auto sizing in WPF
body: <p>I am dynamically creating data grids in a tab window in WPF. I am having an issue with the data grid sizes, that are within the tabControl. </p>
  
  <p>This is not an issue of the size of data within the data grid but the size of data grid itself.  </p>
  
  <p>I am looking to set the height and width to auto. This is simple in XAML but I am struggling to find any information to do it in the code which I need to do..</p>
  
  <p>I have tired double.NaN but this does not seem to work....</p>
  
  <p>Any help would be amazing! </p>
  
  <p>I am using c#.</p>