views:

310

answers:

2

Hi, I am wondering if anyone can help, I am able to bind to a hash table and display values correctly, yet the two-way binding I have specified doesn't update the object when I make changes.

   <DataTemplate x:Key="ResponseItemTemplate">
        <StackPanel Orientation="Horizontal" >
            <TextBox Width="200" Text="{Binding Path=Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
        </StackPanel>
    </DataTemplate>

I don't know if it's anything to do with it being in a DataTemplate?

A: 

You have to use {Binding Path=Value.YOURPROPERTYYOUWANTTOMODIFY .... currently you are binding directly to the object which is in the value property.

Martin Moser
+1  A: 

Enumeration over a Hashtable yields a sequence of DictionaryEntry objects, but DictionaryEntry is a struct, not a class... so you actually get a copy of the DictionaryEntry, so when its value is modified, it doesn't actually modify the entry in the Hashtable.

Thomas Levesque