title: WPF Templates and binding to DataContext in a GridView
body: <p>I'm trying to create a series of bound columns in a RadGridView, and I'm using a template to create hyperlinks in two of the columns. Here is basically what I have:</p>
  
  <pre><code>&lt;telerik:GridViewDataColumn IsReadOnly="True" UniqueName="Distributor" DataContext="{Binding Distributor}" CellTemplate="{StaticResource linkTemplate}"/&gt;
  </code></pre>
  
  <p>and,</p>
  
  <pre><code>    &lt;DataTemplate x:Key="linkTemplate"&gt;
          &lt;TextBlock&gt;
              &lt;Hyperlink DataContext={TemplateBinding DataContext} Click="Hyperlink_Click"&gt;
                  &lt;TextBlock Text="{Binding Name}" /&gt;
              &lt;/Hyperlink&gt;
          &lt;/TextBlock&gt;
      &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>The RadGridView itself is bound to a set of DistributorContainer objects that have, among other things, a Distributor property. The linkTemplate refers directly to properties in the Distributor object, so the hyperlink's datacontext needs to be set to the Distributor.</p>
  
  <p>Unfortunately, the Hyperlink's data context is the DistributorContainer object. I'm using the linkTemplate (as well as the Hyperlink_Click handler) on lists that bind to lists of Distributors, and I'd really like to re-use this template since it's basically the same thing.</p>
  
  <p>Why isn't the template getting the Distributor as its DataContext through the TemplateBinding to the GridViewDataColumn?</p>