473,700 Members | 2,521 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 1398
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

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...
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'??
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?
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. ...
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.
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;
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";
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...
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...
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,...
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...
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...
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();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.