Click here to Skip to main content
15,903,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have problem on how to select my checkboxes, I have successfully programed the saving part of it but having problem on the selecting and deselcting of checkboxes

this one only allows me to deselect one checkboxes, I have already tried nested if but I got lost in the middle, I would appreciate your response.

here's my code behind:

C#
protected void chkActivity_CheckedChanged(object sender, EventArgs e)
    {
        if (chkActivity.Checked == false)
        {
            chkItem.Checked = true;
            chkService.Checked = true;
        }
        else
        {
            chkAll.Checked = false;
            chkActivity.Checked = false;
        }
    }
Posted
Comments
[no name] 13-Aug-13 6:18am    
More explanation of your problem is required.
thanh_bkhn 13-Aug-13 10:32am    
What do you want exactly to do when you click on chkActivity?

Remove this piece of code from else block and give it a try.




C#
chkActivity.Checked = false;
 
Share this answer
 
Hello,
Here, you display very little portion of your code, so I think it may cause due to call event of other check-box which is actually set from your code and do itself to call their event automatically.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900