title: DataGridComboBoxColumn ActionHandler
body: <p>I have a WPF containing a dynamically created DataGridComboBoxColumn this has a comboBox that I can change the value in any row. The table also contains a checkbox in another column, if I change this it calls a method each time a row is changed, I want the same result when I change the value in the combobox</p>
  
  <p>I have a List of my Rum objects that for this purpose have three methods</p>
  
  <pre><code>public int rumStyle { get; set; }
  public string rumStyleDesc { get; set; } // string representation  of ruymStyle
  public bool rumIsValid { get; set; }
  </code></pre>
  
  <p>This checkbox part works</p>
  
  <pre><code>DataGridTemplateColumn textColumnValid = new DataGridTemplateColumn();
  textColumnValid.Header = headerRumIsValid;
  FrameworkElementFactory checkBoxFactory = new FrameworkElementFactory(typeof(CheckBox));
  Binding rumIsValidBinding = new Binding("rumIsValid");
  checkBoxFactory.SetValue(CheckBox.IsCheckedProperty, rumIsValidBinding);
  checkBoxFactory.AddHandler(CheckBox.ClickEvent, new RoutedEventHandler(LostFocus));
  DataTemplate rumIsdValidTemplate = new DataTemplate();
  rumIsdValidTemplate.VisualTree = checkBoxFactory;
  textColumnValid.CellTemplate = rumIsdValidTemplate;
  _dgData.Columns.Add(textColumnValid);
  </code></pre>
  
  <p>This part does display a combobox in each row but I want it to call the LostFocus (or another method) when the selection is changed.</p>
  
  <pre><code>DataGridComboBoxColumn comb = new DataGridComboBoxColumn();
  comb.Header = headerRumStyle;
  comb.SelectedValueBinding = new Binding("rumStyleDesc");
  comb.ItemsSource = _rumStyles.getRumStyleNames();
  FrameworkElementFactory comboFactory = new FrameworkElementFactory(typeof(ComboBoxItem));
  comboFactory.SetValue(ComboBox.SelectedItemProperty, new Binding("rumStyleDesc"));
  comboFactory.AddHandler(ComboBox.SelectionChangedEvent, 
  new SelectionChangedEventHandler(comboBox1_SelectionChanged));
  DataTemplate comboboxTemplate = new DataTemplate();
  comboboxTemplate.VisualTree = buttonFactory;
  // How do I do this part 
  // comb.CellTemplate = comboboxTemplate;
  _dgData.Columns.Add(comb);
  </code></pre>
  
  <p>A second but less important question is can I display the rumStlyeDesc in the combobox but read back the rumstyleId somehow.</p>