Hi all.
I have a dataset with a datatable.
I have a form and a checkbox binded to a boolean field of my datatable.
When i check or uncheck my checkbox the binded row gets updated.
My problem is that when the checkbox is unchecked, apart from updating the corresponding binded field i need to modify another field in the same record.
I tried to use the CheckedChanged event of the checkbox but when i update the row in this event handler the checkbox never changes. (In fact this event is fired twice and the value of the binded field does not change). Here is my code:
...
this.checkBox1.DataBindings.Add(new Binding("Checked", this.dataSet11, "myTable.myBoolField"));
...
private void checkBox1_CheckedChanged(object sender, System.EventArgs e) {
CurrencyManager cm = (CurrencyManager)this.BindingContext[this.dataSet11,"myTable"];
DataRowView drv = (DataRowView)cm.Current;
DataRow dr = drv.Row;
dr["myTextField"] = "asdf";
}
If i comment the last line, the binded fields gets updated, but if i let it uncommented the binded field doesn't change.
Any hint?.
Thnx.
--------------------------------
From: Albert Smith
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>mU9jFE2H90ymjFAIugZRhA==</Id>