473,791 Members | 3,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

retain checked state of checkbox

hi there

can't work out for the life of me at the mo why the code below doesn't
do what I want. the last matching PK it finds sets the checkbox and
this is the only 1 that displays. any ideas please.

int contractCounter = 0;

foreach(Timeshe ets.Contract oContract in allContracts)
{
foreach(Timeshe ets.Contract aContract in contractsOfDele gate)
{
CheckBox selectedContrac t =
(CheckBox)contr actListManageDe legate.Items[contractCounter].FindControl("s el");
selectedContrac t.Checked = false;

if(oContract.PK == aContract.PK)
{
//Check the box
selectedContrac t.Checked = true;

}
}
contractCounter ++;

Nov 30 '05 #1
1 1404
Sorry I've sorted this out.

Nov 30 '05 #2

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

Similar topics

2
2706
by: Pete | last post by:
Just a quick question regarding the way to do something rather than the actual code :- I have a page which has some links that go through to a HTML form and each link will check a certain checkbox. I want the form to retain the checked status of any checkboxes that are set to checked when the user goes back to the previous page. Would this be best done using sessions or is there another way I could use? I don't mind using sessions...
2
4603
by: Jerome | last post by:
Hi, I've got the following problem: I'm retrieving data from an SQL Server database. And I want my form to display a checked box in the state corresponding to the value saved in the DB. But somehow that doesn't work!? SQL tells me the value is 1. My ASP page tells me it's 'True'??
6
6449
by: AFN | last post by:
I want to click a checkbox and have a 4 line (approx) paragraph appear beneath the checkbox, pushing the rest of the page down. And when unchecking the checkbox, the paragraph should disappear and the part below should push back up again. How?
4
2476
by: RodBillett | last post by:
I have a situation where I have 3 checkboxes - and at least 1 needs to be selected at all times... I have implemented the code that allows this behavior to happen, BUT Viewstate gets all messed up. As long as none of the checkboxes are disabled, viewstate works fine - and client actions are 'remembered' after a postback. but when I have one checkbox and it is disabled, then when I postback, ALL checkboxes get the unchecked value. ...
4
1950
by: sydney.luu | last post by:
Hello All, I am programmatically building a table on my web page with one row and two columns. The first column contains a web server checkbox dynamically created and the second column simply contains text of whatever I put in. This is running fine. If I check the checkbox, how would I check if this checkbox is checked or not during postback? The dynamically created checkbox seems to have disappeared during postback.
4
4515
by: sicapitan | last post by:
I have this code snippet: updateProps snippet: if (mycheckbox.checked == '1') ? $('mycheckbox').checked = true : $('mycheckbox').checked = false; content = $('mydiv').innerHTML;
0
12746
acoder
by: acoder | last post by:
Problem Dynamically appended checkbox element does not appear checked despite setting the checked property state to true or "checked". Browser Internet Explorer Example The Javascript code: var cb = document.createElement("input"); cb.type = "checkbox";
4
8565
by: pankajsingh5k | last post by:
Hi guys, These question is for all the experts... Please help me before my brain explodes The problem is again with the formview control.. I have a formview and i have to use it that when it displays it shows values from the database and i have a link button edit on the ItemTemplate that changes the mode to edit mode and allows to edit the values which can be edited...
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9517
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10156
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9997
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.