PC Review


Reply
Thread Tools Rate Thread

About binding checkboxes and multiple row fields modification

 
 
Albert Smith via .NET 247
Guest
Posts: n/a
 
      5th Apr 2005
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>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting info in checkboxes & modification dates herman_hsu@brown.edu Microsoft Outlook 0 25th Jul 2007 05:45 PM
binding navigator delete modification fanor Microsoft ADO .NET 1 5th May 2006 09:46 AM
Re: Binding multiple fields to list box selection Sue Mosher [MVP-Outlook] Microsoft Outlook Form Programming 7 27th Sep 2004 04:27 PM
Binding multiple fields to list box selection =?Utf-8?B?VmF1Z2hhbg==?= Microsoft Outlook Form Programming 0 22nd Sep 2004 05:27 PM
binding checkboxes Keri Microsoft Excel Programming 2 11th May 2004 10:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:51 AM.