views:

30

answers:

1

Hi,

My app. contains the window in the picture:

alt text

The ItemsSource of the DataGrid is set to _editList ( declared as IList < Vendor > _editList;).

The data grid is set to Read Only.

The Vendor Name text box has the binding set as : Text="{Binding ElementName=dataGridVendors, Path=SelectedItem.Name, Mode=TwoWay}"

This works well. However, as it is the Vendor Name cell only updates when the user is done typing in the Vendor Name textbox and clicks on something else. Say I want to change the vendor name to "John Lennon II" . I have to click on the textbox and type the characters I want to add and than I have to click on something else and only then the datagrid makes the update.

I want to make the update happen as the user types the characters....Is this possible ?

Regards, Sebastian

+1  A: 

Add the UpdateSourceTrigger to your Binding

Text="{Binding ElementName=dataGridVendors, Path=SelectedItem.Name, Mode=TwoWay,  UpdateSourceTrigger=PropertyChanged}"

Its default trigger is lost focus. When you change it to PropertyChanged the Updates will done when your typing.

Mark
thanks a lot ! i really appreciate this !
MadSeb