title: Within a ListView - GridViewColumn change content based on ComboBox Selection
body: <p>I am struggling trying to understand how I can allow a user to select a value from a combo box in a GridView column and have that selection impact other items within that GridView column (Labels, Textbox, etc).  If they simply select an item from the combo box I don't appear to have the selected item / index from the ListView nor do I have the GridViewColumn so I can access its contents...This is most likely user error as I am new to WPF.  Any suggestions would be greatly appreciated.  </p>
  
  <p>So in the xaml below I want to be able (for example) change the Label content for a given combo box selection. I can detect the combo box selection in code behind, but need to be able to access the other elements in that grid view column.  </p>
  
  <p><strong>EDIT:</strong> ListView could be the wrong choice to begin with.  I tried DataGrid as well, but this seemed to allow more flexibility within the columns for dynamic content. </p>
  
  <p>Xaml:</p>
  
  <pre><code>&lt;Grid x:Name="GridWindows" DockPanel.Dock="Bottom"&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="*"/&gt;
      &lt;/Grid.ColumnDefinitions&gt;
          &lt;ListView x:Name="LvValues" ItemContainerStyle="{StaticResource AlternatingListViewItemStyle}" AlternationCount="2"&gt;
              &lt;ListBox.Items&gt;
                  &lt;sys:String&gt;Value1&lt;/sys:String&gt;
                  &lt;sys:String&gt;Value2&lt;/sys:String&gt;
                  &lt;sys:String&gt;Value3&lt;/sys:String&gt;
              &lt;/ListBox.Items&gt;
              &lt;ListView.View &gt;
                  &lt;GridView&gt;
                      &lt;GridViewColumn Header="Value" Width="120" DisplayMemberBinding="{Binding}" /&gt;
                      &lt;GridViewColumn Header="Terminal" Width="50"&gt;
                          &lt;GridViewColumn.CellTemplate&gt;
                              &lt;DataTemplate&gt;
                                 &lt;CheckBox IsChecked="False"&gt;&lt;/CheckBox&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/GridViewColumn.CellTemplate&gt;
                      &lt;/GridViewColumn&gt;
                      &lt;GridViewColumn Header="Distribution" Width="400" x:Name="Distribution"&gt;
                          &lt;GridViewColumn.CellTemplate&gt;
                              &lt;DataTemplate&gt;
                                  &lt;StackPanel Orientation="Horizontal"&gt;
                                  &lt;ComboBox Width="100" x:Name="CbDistribution" SelectedValuePath="Content" SelectionChanged="CbDistribution_OnSelectionChanged"&gt;
                                      &lt;ComboBoxItem x:Name="Beta"&gt;Beta&lt;/ComboBoxItem&gt;
                                      &lt;ComboBoxItem x:Name="Constant"&gt;Constant&lt;/ComboBoxItem&gt;
                                      &lt;ComboBoxItem x:Name="Gamma"&gt;Gamma&lt;/ComboBoxItem&gt;
                                  &lt;/ComboBox&gt;
                                      &lt;Label x:Name="DistributionArg1" Content="k="&gt;&lt;/Label&gt;
                                      &lt;Label x:Name="DistributionArg2" Content="Theta="&gt;&lt;/Label&gt;
                                      &lt;Label x:Name="DistributionArg3" Content="Other="&gt;&lt;/Label&gt;
                                  &lt;/StackPanel&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/GridViewColumn.CellTemplate&gt;
                      &lt;/GridViewColumn&gt;
                  &lt;/GridView&gt;
              &lt;/ListView.View&gt;
          &lt;/ListView&gt;
      &lt;/Grid&gt;
  </code></pre>