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 7575755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:45:27+00:00 2026-05-30T16:45:27+00:00

I have a problem when binding a Textbox to the Value of a Station

  • 0

I have a problem when binding a Textbox to the Value of a Station Object. The values are displayed correctly, but when i edit the values on screen the Source isn’t updated. What am i doing wrong?

    public LineControl(ArrayList cells)
    {


        InitializeComponent();
        this.cells = cells;
        foreach (Cell c in cells)
        {
            AccordionItem aci = new AccordionItem();

            StackPanel sp = new StackPanel();
            aci.Content = sp;
            DataGrid dg = new DataGrid();

            if(c.Stations!=null)
            foreach (Station s in c.Stations)
            {

                TextBox t = new TextBox();
                t.DataContext = s;
                 Binding binding = new Binding();
                 binding.Mode = BindingMode.TwoWay;
                 binding.Source = s;
                 binding.Path = new PropertyPath("Value");
                 binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
                 t.SetBinding(TextBox.TextProperty, binding);
                 //t.TextChanged += new TextChangedEventHandler(t_TextChanged);

                sp.Children.Add(t);
            }
            acc.Items.Add(aci);
        }
}

My Station Class looks like

class Station
{
    public int Id { get; set; }
    public String Name { get; set; }
    public int Value { get; set;  }

}

In my XAML there isn’t anything significant:

     <UserControl x:Class="Knowles_ShiftreportEditor.LineControl"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         xmlns:toolkit="clr-   namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
         mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="100">
<Grid>

    <toolkit:Accordion Width="100"  Name="acc" SelectionMode="One" Loaded="acc_Loaded">
    </toolkit:Accordion>
</Grid>

  • 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-30T16:45:28+00:00Added an answer on May 30, 2026 at 4:45 pm

    Have you tried implementing INotifyPropertyChanged on your Station class? Also, what is the type used for your Stations collection at the top of your foreach loop?

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

Sidebar

Related Questions

I have a problem with binding data using BindingSource, typed dataset and DataGridView. My
I have a problem with updating the value of property from code which is
I have this xaml textbox <TextBox Text={Binding ProdFilter.Min, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged, TargetNullValue=''} Width=50 DockPanel.Dock=Right TabIndex=3
I have a problem with data binding my user control into a DGV. When
I have used DependencyProperty to pass value from textbox at silverlight page to external
I have problems binding both a telerik RadGrid and a plain vanilla ASP.NET GridView
I have problems with my keyup binding when cloning an element. Here's the scenario:
The problem is basically this, in python's gobject and gtk bindings. Assume we have
Ok, here's a problem I'm having. I have Lua bindings to a rendering engine
I have problem in some JavaScript that I am writing where the Switch statement

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.