title: WPF DataGrid switch template between view mode and edit mode
body: <p>If have a WPF <code>DataGrid</code> on the left of a Window with an area to the right for displaying the selected record. The selected record consists of <code>Textbox</code>es and <code>ComboBox</code>es that are disabled until the edit button is clicked. All works as expected.</p>
  
  <p>However, it seems a bit clumsy to be populating <code>ComboBox</code>es when the <code>SelectedItem</code> of the <code>DataGrid</code> being changed. A much lighter control such as a <code>TextBlock</code> could be used until the Edit button is clicked, then the <code>TextBlock</code>s could be switched out for <code>ComboBox</code>es.</p>
  
  <p>I'm sure this can be done with some sort of templating but when I tried to experiment with this, all of the events that are associated with the <code>ComboBox</code>es report an error as they're no longer present as they have been replace with TextBlocks in "View mode".</p>
  
  <p>I'm probably going about this wrong so some guidance would be appreciated.</p>