Quantcast
Channel: Silverlight 5 forum
Viewing all articles
Browse latest Browse all 1083

UpdateSourceTrigger=PropertyChanged is Ignored

$
0
0

Hello,

I'm having a really weird behavior:

I have a "Listbox" and a "Datagrid":

<ListBox ItemsSource="{Binding SomeTexts}" ItemTemplate="{StaticResource DataTemplate1}"/>

and

<sdk:DataGrid AutoGenerateColumns="False" ItemsSource="{Binding SomeTexts}"><sdk:DataGrid.Columns><sdk:DataGridTemplateColumn CellTemplate="{StaticResource DataTemplate3}" CellEditingTemplate="{StaticResource DataTemplate1}"  /></sdk:DataGrid.Columns></sdk:DataGrid>

As you can see both have the same "ItemTemplate" which is:

<DataTemplate x:Key="DataTemplate1"><StackPanel><TextBox Text="{Binding Item1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/></StackPanel></DataTemplate>

The thing is, in the "Listbox" the data gets updated on "PropertyChange" as expected,
However in the "DataGrid" the data gets updated on "LostFocus".

And the weirdest this is, that if i delete the "CellTemplate" of the "DataGrid" (which is a simple "TextBlock") and leave only the "CellEditTemplate" it works again!

Why?!?

Help me! please! =[

jony


P.s

public ObservableCollection<MyPair> SomeTexts

"MyPair" is a simple object that exposes a string "Item1".
"MyPair" implements "INotifyPropertyChanged"



Viewing all articles
Browse latest Browse all 1083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>