title: WPF LIstView Binding to Column Headers
body: <p>I'm attempting to create a listview that binds dynamically to a set of dates. So the user would b able to select a date range and the results for the chosen dates would show up with the date in the column header. I've got it all working with just one problem, the dates don't show up in the header. I've got the following which I can't see any reason why it doesn't work:</p>
  
  <pre><code>public class KPIResult : DependencyObject
  {
      public static readonly DependencyProperty DateProperty = DependencyProperty.Register("Date", typeof(DateTime), typeof(KPIResult), new UIPropertyMetadata(null));
  
      public DateTime Date
      {
          get { return (DateTime)GetValue(DateProperty); }
          set { SetValue(DateProperty, value); }
      }
  
      public static readonly DependencyProperty ResultProperty = DependencyProperty.Register("Result", typeof(int), typeof(KPIResult), new UIPropertyMetadata(null));
  
      public int Result
      {
          get { return (int)GetValue(ResultProperty); }
          set { SetValue(ResultProperty, value); }
      }
  }
  </code></pre>
  
  <p>And the code for the ListView:</p>
  
  <pre><code>    &lt;ListView Margin="6" ItemsSource="{Binding ElementName=This, Path=KPICollection}" Name="lvKPIView" Grid.ColumnSpan="2"&gt;
          &lt;ListView.View&gt;
              &lt;GridView&gt;
                  &lt;GridViewColumn Width="40" &gt;
                      &lt;GridViewColumnHeader Tag="KPIResult[0]" Content="{Binding Path=KPIResults[0].Date}" /&gt;
                      &lt;GridViewColumn.CellTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;Grid&gt;
                                  &lt;TextBlock Text="{Binding Path=KPIResults[0].Result}" /&gt;
                                  &lt;TextBox Text="{Binding Path=KPIResults[0].Result}" /&gt;
                              &lt;/Grid&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/GridViewColumn.CellTemplate&gt;
                  &lt;/GridViewColumn&gt;
              &lt;/GridView&gt;
          &lt;/ListView.View&gt;
      &lt;/ListView&gt;
  </code></pre>
  
  <p>The results are displayed just fine. Just no dates in headers :(.</p>
  
  <p>Any ideas guys?</p>
  
  <p>Cheers,
  SumGuy</p>