ADO Entity Framework 4 to WPF Datagrid. DatagridComboBox nightmare.
- by Jason
The WPF datagrid -seems- like it's going to work, but the combobox implementation does not work straight from the designer. So I'm left wandering around in the XAML randomly changing things trying to get it to work.
The problems are numerous. I want to display a foreign key relationship (with drop down) instead of a bunch of numbers for a selection. It seems like it shouldn't be this hard.
I can get the right values to show up (their description instead of an ID), but the table freaks out thinking that all the values have been modified. If I select a drop down, it refuses to allow me to edit anything else.
I want to chalk this up as a .NET bug, but since I'm new to WPF datagrids, it's probably just me. Here is the code.
<DataGridComboBoxColumn Header="Make Up" ItemsSource="{Binding Source={StaticResource materialMakeUpTypesViewSource}}"
DisplayMemberPath="Description" TextBinding="{Binding Path=MaterialMakeUpType.Description}"
SelectedItemBinding="{Binding Path=MaterialMakeUpType.Description}" SelectedValueBinding="{Binding Path=MaterialMakeUpType.ID}" />