.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Uncheck one checkbox when another checkbox unchecks ?

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :WPF
For a lack of a checkboxlist in WPF I'm using 11 single checkboxes.  I have a "selectall" checkbox.  I have it set so when I check selectall, all checkboxes get checked and when I uncheck selectall, all checkboxes get unchecked (so far so good). My problem is that I want to deselect selectall when any of the other checkboxes get unchecked.  With the checkboxlist in forms it was easy with some logic, but I'm lost in wpf.  I don't want to code the uncheck event for every checkbox on the app.  IS there a way to do it via the XAML code? even if I have to do it on all checkboxes.NR

View Complete Post

More Related Resource Links

Datagrid checkbox check uncheck in single click

Hi, I have a datagrid colums of checkbox type. Users have to click twice on the checkbox to check or uncheck. Is there a way to do this in one click. Thanks Vijay

uncheck single checkbox in gridview template



i have two checkboxes  in two templete fileds in a gridview .

but i want to  uncheck only single checkbox when i click on button which is ouside of the grid,


AJAX GridView Checkbox Select All in ASP.Net

In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

jQuery: Highlight Gridview Rows with Checkbox

Im learning and experimenting with jQuery and ASP.NET. Below is a simple solution I created to highlight rows in a gridview by clicking on a checkbox next to the row.

Gridview setup:

jQuery: Highlight Gridview Rows with Checkbox

Im learning and experimenting with jQuery and ASP.NET. Below is a simple solution I created to highlight rows in a gridview by clicking on a checkbox next to the row.

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

How to read value of CheckBox in EXCEL sheet


I am using OLEDBConnection (@"Provider=Microsoft.ACE.OLEDB.12.0;") to connect to the EXCEL file and read contents. When I read the contents, I get all the contents from the excel sheet but i dont get contents for checkboxes placed inside.

My Excel sheet contains set of checkboxes and I need to know If they are checked or not.These checkboxes are controls which are added from Developer tab in EXCEL.

I dont want to use Excel Assemblies for reading contents as it is not recommended. And also i am using OLEDBconnection and want to stick to this .

Awaiting replies from you guys. Thanks in Advance.

Checkbox disable/enable


I hope someone can be kind enough to help/advise me with this.

I have a web form with multiple checkboxes on it , with one of the checkboxes as the main (controlling) checkbox.  By this I mean that when this main checkbox is checked then all the other checkboxes need to be disable and when its unchecked these other checkboxes need to be enable.

I've found (plenty of) code to do this in javascript but i would really prefer to to it in vb(.net), if possible.

I hope all this makes sense to you.


Checkbox will show panel based on selection without postback.. how to do



I have Two Checkbox in my asp.net textbox..

First what i want is

based on two checkbox user has to be select any one only..

if checkbox1 is selected then Panel1 visible true without postback

if checkbox2 is selected then Panel2 visible true without postback

checkbox question


How can i see if a check box was checked with razor. I am trying to do Request["checkbox"] and it returns nothing. (checkbox is the "name" of the checkbox). Any help? 

Gridview Checkbox


in my gridview I have 5 column, that include checkbox, I want to check only one checkbox in a row. How can do it? Can anybody help me? Thanks.

 <asp:TemplateField HeaderText="1">
         <asp:CheckBox ID="chk1" runat="server" />
  <asp:TemplateField HeaderText="2">
        <asp:CheckBox ID="chk2" runat="server" />
   <asp:TemplateField HeaderText="3">
        <asp:CheckBox ID="chk3" runat="server" />
    <asp:TemplateField HeaderText="4">

Using Checkbox and MultiSelect for Roles


I am new to MVC and am using MVCContrib and trying to use the Checkboxlist .My requirement is to display list of all available roles on create user page . I have dine as below .

<%=this.CheckBoxList("Roles").Label("Roles:").Options(new MultiSelectList(Roles.GetAllRoles(),"DataTextField","DataValueField"))%>

In this case GetAllRoles method retuns string[] . How can I assign the "DataTextField","DataValueField" to make it work ?

Thanks in advance.

how to get the text of selected checkbox from asp.net checkboxlist control using jquery


I have asp.net checkboxlist control that bounded to a data source so the number of items in the control are different from one to to another time.

I have this function:

     $('#<%=chkListGroups.ClientID %> input:checkbox:checked').siblings('label').text();

this function will return all texts for all selected items in the control as a one string.

 I'm looking for a way that when I check a check box from the ckeckboxlist control will return only last checked checkbox.

this code :

$('#<%=chkListGroups.ClientID %> input:checkbox:checked').last().siblings('label').text(); 

returns last checked item for example if I checked second will return
second item then when I checked fifth item will return fifth item but
if now when I check third item will return fifth item so it is always
returning last item checked in the list and I'm looking to

Please advice me how to do this using jquery.

How to get Click event to work with checkbox


I am new to ASP.Net and I'm having trouble figuring out what needs to be where in my code.  I have a webform with 2 listboxes and 2 checkboxes... When I check checkbox1 I want listbox1 to be disabled and checkbox2 to be disabled.  Similarly, when I check checkbox2 I want listbox2 to be disabled and checkbox1 to be disabled.  The code does not show any errors; however, when I run the Page everything appears as it is supposed to but when I check the boxes, nothing happens.  What am I missing that will link the code on the .aspx.vb page to the objects on the .aspx page and make them work together?

Here is my code for Page1.aspx.vb:

Public Class LCPage1
    Inherits System.Web.UI.Page

    Protected Sub AllClients_Click(ByVal sender As ObjectByVal e 

How to set the checkbox state "checked or not checked" from a database


hey In the code I have here, I need to set the checkbox state from a database but I dont know the properties:

while (l_objRead.Read())
                         //txtUserName.Text = l_objRead["UserName"].ToString().Trim();
                         txtWerknemerNaam.Text = l_objRead["Naam"].ToString().Trim();
problem here => cbAktief.CheckState = l_objRead["Aktief"];

don't know how to set the state, help pleaz :)

validate the selection of atleast one checkbox in the gridview using javascript


 i have a gridview with a checkbox in the templatefield as given  below,

<asp:GridView runat="server" ID="gvAsgnHw"  AutoGenerateColumns="False"   >
        <asp:CheckBox id="cbAsgnHwGrid"   runat="server" /> </ItemTemplate></asp:TemplateField>

         <asp:BoundField DataField="Resource_id" HeaderText="Resource ID"/>
        <asp:BoundField DataField="Resource_name" HeaderText="Hardware Name" />

I want to check the selection of atleast one checkbox on a button click using javascript.
pls help

Checkbox Value Problem


Hi Guys,

I have a problem with razor in a checkbox. It does not get a checked value.

Here is the code:

PageData["Title"] = "Edit Your Profile - ";

var db = Database.OpenFile("mySite.sdf");
var selectQuerySingle = "SELECT * FROM UserProfiles, webpages_Membership WHERE UserProfiles.UserId = webpages_Membership.UserId AND UserProfiles.UserId=@0 AND webpages_Membership.UserId=@0 ";
var UserId = UrlData[0];

if (UserId.IsEmpty())

var row = db.QuerySingle(selectQuerySingle, UserId);

var firstname = row.firstname;
var lastname = row.lastname;
var email = row.email;
var phone = row.phone;
var address = row.address;
var city = row.city;
var zipcode = row.zipcode;
var country = row.country;
var isconfirmed = "";

if (IsPost)

firstname = Request["firstname
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend