emblewembl
Programmer
I'm developing a Windows application which starts by populating one object of type Meeting. It's set up as follows:
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:
I've set up a test button which does this OnClick:
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
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