473,395 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

About binding checkboxes and multiple row fields modification

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>
Nov 21 '05 #1
0 898

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Timm | last post by:
I have an ASP.NET 2.0 page with two DropDownLists. I am using declarative data binding wherever possible and trying to minimize the use of code. The list of values in DropDownList DDL2 should be...
9
by: Jaybuffet | last post by:
my aspx has something like this <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <mycontrol:ctl id="ctlId" obj='<%# Container.DataItem %>' showItem="true"/> </ItemTemplate>...
7
by: Ryan | last post by:
I'm in the process of learning more about building my ASP.NET website to use my SQL datastore and am a bit confused about how ADO.NET works with ASP.NET. This Microsoft article implies that using...
2
by: bmayer | last post by:
I am using a detail view and binding it to a sql data source (at some point in the future it will be an object data source). I have seen the article "Working with Data is ASP.NET 2.0 ::...
3
by: trgpham | last post by:
Hi all, I have a question and really hoping you guys can help or point me to the right direction. MY SCENARIO: I need to design a screen which show up all the questionnaires and the users can...
3
by: mountain.dog | last post by:
I have a query that shows a list of options that a user can toggle on or off using a checkbox. query... form... while($row = mysql_fetch_array($result))... <input name="menu_show_attribute"...
3
by: santoshjsh | last post by:
hello everyone, i have a gridview in which i have multiple checkboxes in a single column. means for every row in the gridview i have four checkboxes in one column e.g Add, Delete, Print,...
3
by: goldybobble | last post by:
Hello, I had an Access database that would classify items with one classification, and then classify one sub-classification based on the selection for the main classification. This worked well,...
10
by: Descartes | last post by:
Dear All, Coming from another development environment, it appears that I bang my head in the wall on very basic matters, so I hope you can give me a push in the right direction. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.