ComboBox in a Grid displayed as RowLevelDetails works with Keyboard but not Mouse

Apr 27, 2009 at 6:22 PM
Edited Apr 27, 2009 at 8:15 PM
Hi there.

More Grid Fun!

I have a Grid which is used to display a heirarchical Domain Objects.  When I click no the parent row, the RowDetailsTemplate 
is defined as a grid as well.

For Example assume my observableCollection heirarchy is Customer which has a Collection of Orders.  When I click on a customer in the grid, my RowDetailsTemplate shows me a "nested" grid of Orders.

This solution is from Colin E. and it works great especially for displaying readonly information.

The child grid (the Orders) can even be edited as well!  What I am now seeing is the need for a combobox for one of the column in the nested Grid.

I was able to get the ComboBox to show but it has very strange behavior:  I can select from the combobox only when I use the keyboard.  When I use the mouse, it appears to ignore the selection make an resets to the loaded (bound) value.
Help!  and thanks 8->  

Apr 27, 2009 at 8:49 PM
Here is the associate code sample:

             ItemsSource="{Binding Path=Customers}" 
            Grid.Row ="0"
                            <dg:DataGrid  ItemsSource="{Binding Path=Orders}" 
                                         Name="dataGrid2" AutoGenerateColumns="False">
                                    <dg:DataGridTextColumn Header="Desc" Binding="{Binding Path=Desc,ValidatesOnDataErrors=True,Mode=TwoWay}" 
Width="150" EditingElementStyle="{StaticResource CellEditStyle}" />

                                    <dg:DataGridComboBoxColumn Header="Order Status" 
                                           SelectedValueBinding="{Binding OrderStatus}"
                                            <Style TargetType="{x:Type ComboBox}">
                                                <Setter Property="ItemsSource" Value="{Binding Path=DataContext.StatusList, 
RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}" />
                                            <Style TargetType="ComboBox">
                                                <Setter Property="ItemsSource" Value="{Binding Path=DataContext.StatusList, 
  RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}" />



                            </dg:DataGrid >
                    <dg:DataGridTextColumn Header="Name"
                                  Binding="{Binding Path=Name,ValidatesOnDataErrors=True,Mode=TwoWay}" Width="150" EditingElementStyle="{StaticResource CellEditStyle}" />
            </dg:DataGrid >

Apr 29, 2009 at 3:15 PM
It appears that the parent row receives the same SelectionChanged event as the child combobox.   Using the JanRelease, there is a workaround that includes canceling the ParentEvent and allowing the ChildEvent to continue. (Thanks Mahender for finding that solution!)

It appears that this is addressed as a bug fix in the March2009 release, however.   Does anyone know which bug is related to this issue (which work item?)

Also, is there a full list of release note for the March09 wpftoolkit?  I used the advanced search on issue tracker an didn't see any associated with the March Release.