Note that there are some explanatory texts on larger screens.

plurals
  1. POError when Databinding with mode=twoway
    primarykey
    data
    text
    <p>All, I'm pounding my head against the wall here. What I need is simple, and I'm sure there is a simple answer, but I can't seem to find it. Situation: I have a Silver light 4.0 app and I'm currently binding a list of strings to an Items control. In the data template for that I have a simple text box that I was doing very basic Binding "{Binding}". I need to update the binding to be twoway so the edits are automatically pushed back to my datacontext. </p> <p>Here is the Items control before I update the binding:</p> <pre><code>&lt;ItemsControl x:Name="spLiftHeader" ItemsSource="{Binding Path=WeekLabels}"&gt; &lt;ItemsControl.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;StackPanel x:Name="spLiftHeader" Orientation="Horizontal" /&gt; &lt;/ItemsPanelTemplate&gt; &lt;/ItemsControl.ItemsPanel&gt; &lt;ItemsControl.ItemTemplate&gt; &lt;DataTemplate&gt; **&lt;TextBox x:Name="txtWeekLbl" Text="{Binding}" Foreground="Black" Width="125" TextAlignment="Center"/&gt;** &lt;/DataTemplate&gt; &lt;/ItemsControl.ItemTemplate&gt; &lt;/ItemsControl&gt; </code></pre> <p>Here is the items control after the binding change:</p> <pre><code>&lt;ItemsControl x:Name="spLiftHeader" ItemsSource="{Binding Path=WeekLabels}"&gt; &lt;ItemsControl.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;StackPanel x:Name="spLiftHeader" Orientation="Horizontal" /&gt; &lt;/ItemsPanelTemplate&gt; &lt;/ItemsControl.ItemsPanel&gt; &lt;ItemsControl.ItemTemplate&gt; &lt;DataTemplate&gt; **&lt;TextBox x:Name="txtWeekLbl" Text="{Binding Mode=TwoWay}" Foreground="Black" Width="125" TextAlignment="Center"/&gt;** &lt;/DataTemplate&gt; &lt;/ItemsControl.ItemTemplate&gt; &lt;/ItemsControl&gt; </code></pre> <p>I've just simply added the "Mode=TwoWay" to the binding. After updating that, I get the amazingly useless error 4004 "System.Windows.Markup.XamlParseException: Provide value on 'System.Windows.Data.Binding' threw an exception" and the Line/Position reference points right do my updated Binding. How does one add the Two Way mode to the simple binding? Thanks in advance. Nick</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload