ADO Entity Framework 4 to WPF Datagrid. DatagridComboBox nightmare.

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2010-05-13T12:24:41Z Indexed on 2010/05/14 11:54 UTC
Read the original article Hit count: 861

Filed under:
|
|
|

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}" />  

© Stack Overflow or respective owner

Related posts about wpf

Related posts about ADO.NET