Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Databindings & Custom Object - control not automatically refreshing

Status
Not open for further replies.

emblewembl

Programmer
May 16, 2002
171
GB
I'm developing a Windows application which starts by populating one object of type Meeting. It's set up as follows:

Code:
private static Meeting masterMeeting;
//get meeting data and populate masterMeeting object.
       masterMeeting = rtd.InitialiseMeetingData(selectedLocation);

This sucesfully populates the object. I then have several labels which are databound to the Race object which is part of the Meeting object. The Races are stored in a public property of the meeting object as List<Race>. I choose a selected race (selectedRace) and then set my databindings up like this:

Code:
lbRaceGoing.DataBindings.Clear();
                lbRaceGoing.DataBindings.Add(new Binding("Text", selectedRace, "Going", true, DataSourceUpdateMode.OnValidation));

I've set up a test button which does this OnClick:

Code:
private void btnTest_Click(object sender, EventArgs e)
{
 //modify the masterMeeting object and see if the   
 //databindings pick it up.
 selectedRace.Going = "TEST222";
}

This sucesfully changes the selectedRace object but the label doesn't refresh at all!! If I navigate to a different race, then back to the one that was selected when I tested this, it has actually been changed and it's 'Going' property is 'Test222'.

WHy is the label not refreshing automatically?

i love chocolate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top