Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6730897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:27:50+00:00 2026-05-26T10:27:50+00:00

All, I’m pounding my head against the wall here. What I need is simple,

  • 0

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.

Here is the Items control before I update the binding:

<ItemsControl x:Name="spLiftHeader" ItemsSource="{Binding Path=WeekLabels}">
   <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
             <StackPanel x:Name="spLiftHeader" Orientation="Horizontal" />
        </ItemsPanelTemplate>
   </ItemsControl.ItemsPanel>
   <ItemsControl.ItemTemplate>
         <DataTemplate>
              **<TextBox x:Name="txtWeekLbl" Text="{Binding}" Foreground="Black" Width="125" TextAlignment="Center"/>**
         </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>

Here is the items control after the binding change:

<ItemsControl x:Name="spLiftHeader" ItemsSource="{Binding Path=WeekLabels}">
   <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
              <StackPanel x:Name="spLiftHeader" Orientation="Horizontal" />
        </ItemsPanelTemplate>
   </ItemsControl.ItemsPanel>
   <ItemsControl.ItemTemplate>
        <DataTemplate>
            **<TextBox x:Name="txtWeekLbl" Text="{Binding Mode=TwoWay}" Foreground="Black" Width="125" TextAlignment="Center"/>**
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:27:50+00:00Added an answer on May 26, 2026 at 10:27 am

    Two-way binding to an entire object (a string in this case) makes no sense to Silverlight so it is correct to throw an exception. Shame it is not a more useful error message 🙂

    When there is no Path in the binding the ItemsControl can fetch a value using Object.ToString(), but where will it store the result back? It can’t replace the string as that would require placing a new string object back in the collection. Two-way binding is done via reflection against a property of an object.

    Instead of a simple list of strings, use a list of some new object that contains a string property and explicitly bind to that property. It will make everything a lot easier. (Make sure your new class and property implement INotifyPropertyChanged).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, There is a website that doesn't seem legitimate that and keeps showing all
All I need this for is strcpy(). I want to see whether the first
All it does is output 'CHECK' which I put in to make sure it
All my searches returned nothing and I find it odd that there aren't any
All the examples I've come across using Google Maps API seem to show a
All I want is a pragmatic random number generator in C# so I can
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
All I need is to create a file that contains a file names' list
All I want is to make a simple user password login. I have put
all, I am trying to multiply a matrix to a vector in OpenGL, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.