title: WPF ListView Column of Text Some Rows Underlined Some Not
body: <p>I need to display databound data in a listview such that some of the cells of the same column are underlined while others are not:</p>
  
  <p>How do I create a data template that will display different control types in the same cell? (Visual Studio 2013, .NET 4.5.2)</p>
  
  <p>XAML:</p>
  
  <pre><code>&lt;ListView Grid.Column="3" ItemsSource="{Binding Results.MyItemSource, Mode=OneWay}"&gt;
      &lt;ListView.View&gt;
          &lt;GridView&gt;
              &lt;GridView.Columns&gt;
                  &lt;GridViewColumn Width="Auto" Header=" " DisplayMemberBinding="{Binding Path=Caption, Mode=OneWay}"/&gt;
                  &lt;GridViewColumn Width="Auto" Header=" " DisplayMemberBinding="{Binding Path=Value, Mode=OneWay}" &gt;
                      &lt;GridViewColumn.CellTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;StackPanel /&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/GridViewColumn.CellTemplate&gt;
                  &lt;/GridViewColumn&gt;
              &lt;/GridView.Columns&gt;
          &lt;/GridView&gt;
      &lt;/ListView.View&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>ItemSource:</p>
  
  <pre><code>public List&lt;object&gt; MyItemSource
  {
     get
     {
        return new List&lt;object&gt;
        {
           new CaptionValuePair {Caption = "Caption1", Value = new TextBlock {Text = "Value1"}},
           new CaptionValuePair {Caption = "Caption2", Value = new TextBlock {Text = "Value2", TextDecorations = TextDecorations.Underline}}
        };
     }
  }
  </code></pre>
  
  <p>Bound type:</p>
  
  <pre><code>public class CaptionValuePair
  {
     public string Caption { get; set; }
  
     public object Value { get; set; }
  }
  </code></pre>
  
  <p>Problem: The StackPanel is just displaying the typename of a textblock. </p>