title: WPF radcombobox: get values from multiple columns
body: <p>I have a radcombobox with 2 columns and need the value from the 2nd column.  I'm using this code to obtain the value in the dropdownclosed event:</p>
  
  <pre><code>                theValue = DirectCast(cboSheen.SelectedValue, System.Data.DataRowView).Row("pctUpcharge")
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code>                       &lt;telerik:RadComboBox x:Name="cboSheen" FontSize="16" Margin="0,8,0,0" Background="#F6F8FA" BorderBrush="#D7D8DD" ItemsSource="{Binding}" Text="{Binding sheen}" TextSearch.TextPath="Sheen" IsEditable="True" Style="{DynamicResource RadComboBoxStyle3}" &gt;
                              &lt;telerik:RadComboBox.ItemTemplate&gt;
                                  &lt;DataTemplate&gt;
                                      &lt;DataGridRow DataContext="{Binding}" Width="400"&gt;
                                          &lt;DataGridRow.Template&gt;
                                              &lt;ControlTemplate&gt;
                                                  &lt;Grid&gt;
                                                      &lt;Grid.ColumnDefinitions&gt;
                                                          &lt;ColumnDefinition/&gt;
                                                          &lt;ColumnDefinition/&gt;
                                                      &lt;/Grid.ColumnDefinitions&gt;
                                                      &lt;TextBlock Grid.Column="0" Text="{Binding Sheen}" /&gt;
                                                      &lt;TextBlock Grid.Column="1" Text="{Binding pctUpcharge}" /&gt;
                                                  &lt;/Grid&gt;
                                              &lt;/ControlTemplate&gt;
                                          &lt;/DataGridRow.Template&gt;
                                      &lt;/DataGridRow&gt;
                                  &lt;/DataTemplate&gt;
                              &lt;/telerik:RadComboBox.ItemTemplate&gt;
                          &lt;/telerik:RadComboBox&gt;
  </code></pre>
  
  <p>This does the job almost 100% of the time but there are times when it bombs out with this error:</p>
  
  <blockquote>
    <p>System.NullReferenceException: Object reference not set to an instance of an object.</p>
  </blockquote>
  
  <p>I can immediately reselect the item from the combobox and the code will work OK.</p>
  
  <p>So it appears that this line of code is not stable.  Is there a better way to get this value?</p>
  
  <p>Thanks</p>