If have a WPF datagrid on the left of a Window with an area to the right for displaying the selected record. The selected record consists of Textboxes and ComboBoxes that are disabled until the edit button is clicked. All works as expected.
However, it seems a bit clumsy to be populating ComboBoxes when the SelectedItem of the DataGrid being changed. A much lighter control such as a TextBlock could be used until the Edit button is clicked, then the TextBlocks could be switched out for ComboBoxes.
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 ComboBoxes report an error as they're no longer present as they have been replace with TextBlocks in "View mode".
I'm probably going about this wrong so some guidance would be appreciated.