Updating DataGrid cell content: Different in March Release?

Mar 25, 2009 at 2:25 PM
On my DataGrid I have a ComboBox column.  I handle its SelectionChanged event to update the value of two text columns so the user can see the new values before the row is commited.  This worked fine in the January release, but now with the March 21st release the columns aren't being updated when UpdateTarget() is called.  Is there anything that I've overlooked?

private void cboType_SelectionChanged(object sender, SelectionChangedEventArgs e)


DataGridRow row = (DataGridRow)dataGrid.ItemContainerGenerator.ContainerFromIndex(dataGrid.SelectedIndex);

DataGridColumn columnBasedOn = dataGrid.Columns.Where(c => c.Header.ToString() == "Based On").First();

DataGridColumn columnAmount = dataGrid.Columns.Where(c => c.Header.ToString() == "Amount").First();




Mar 26, 2009 at 12:11 AM
How come you are unable to see the combobox update even without doing that?  What does your ComboBox column declaration look like?
Mar 26, 2009 at 3:40 PM
Sorry, I think I understand my problem better now.

The combobox is bound to a property of the data record which determines the value of the two other columns.  In the January release, when the selected item in the combobox changes, the property it's binding to is immediately updated.  In the March release the propery is updated after the combobox loses focus.  The UpdateSourceTrigger for the combobox column's binding is set to PropertyChanged, so I'm confused.  I tested this out by uninstalling the March release and installing January's and, without changing any code, the behaviour changed. 

Thanks for bearing with me.

<toolkit:DataGridComboBoxColumn Header="Fee Type" ItemsSource="{Binding Source={StaticResource feetypesDataProvider}}" DisplayMemberPath="Name" SelectedValueBinding="{Binding Path=FeeTypeID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValuePath="RecordID">


        <Style TargetType="ComboBox">

            <EventSetter Event="SelectionChanged" Handler="cboType_SelectionChanged"/>




<toolkit:DataGridTextColumn Header="Based On" IsReadOnly="True" Binding="{Binding Path=FeeType.BasedOn}"/>

<toolkit:DataGridTextColumn Header="Amount" Binding="{Binding Path=Amount, Converter={StaticResource MoneyConverter}, Mode=TwoWay}"/>

May 19, 2010 at 10:40 PM
Edited May 19, 2010 at 10:41 PM

I'm seeing the same problem. I do not have any event handler for SelectionChanged, but the SelectedValueBinding is not immediately setting the binding source property. This is even with UpdateSourceTrigger. 

The update happens when combo box loses focus, which does not help my scenario of dynamic content changes.

Note: I'm using the latest toolkit release ( Feb 2010).