title: How to retrieve Data Type from DataGrid of each column + WPF
body: <p>I need to modify each column header's name to reflect the unit of each column. Currently, my DataGrid is bind to a list that contains various properties. When the data grid is loaded, the header should be in this format "HeaderName (unit)" for each column. I'm having hard time to retrieve the type of my property in order to display the unit. How can I get the type of each column from DataGrid?<br>
  Right now I'm hard coding it as below, if I know the type I can retrieve those units without having to hard code.</p>
  
  <pre><code>private void DataGrid_Loaded(object sender, RoutedEventArgs e)
   {
     dg.Columns[0].Header = dg.Columns[0].Header + "(m/s)"; //=&gt; Speed (m/s)
     dg.Columns[1].Header = dg.Columns[1].Header + "(s)"; //=&gt; Duration (s)
     ...
     dg.Columns[7].Header = dg.Columns[7].Header + "(s)"; //=&gt; Duration (s)
  
   }
  </code></pre>
  
  <p>My sample xaml:</p>
  
  <pre><code>&lt;DataGrid  ItemsSource="{Binding Path=ObjectList}"                    
                        SelectionMode="Single" Name="dg" Loaded="DataGrid_Loaded"/&gt;
  </code></pre>
  
  <p>ObjectList</p>
  
  <pre><code>public class ObjectList
  {
      public Speed Speed { get; set; }
      public Time Duration { get; set; }
      public Ampere Current { get; set; }
      ... (almost 8 properties)
  }
  </code></pre>
  
  <p>I don't prefer to bind each type in the collection in xaml. I would like to keep the binding to the entire collection itself as in above xaml.</p>
  
  <p>Is there a simple or a good way to achieve this ?</p>