Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8470545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:32:58+00:00 2026-06-10T16:32:58+00:00

The Students Gridview has a Check All checkbox at the top and it controls

  • 0

The Students Gridview has a Check All checkbox at the top and it controls the on/off of the checkboxes. I want to toggle checkboxes on and off in the Students Grid View. Here is my code:

$(document).ready(function () {
    $("#chkAll").click(function () {
        if ($(this).prop("checked") == "checked") {
            $("#<%= gvStudents.ClientID %> :checkbox").not(this).prop("checked", "checked");
        }
        else {
            $("#<%= gvStudents.ClientID %> :checkbox").not(this).prop("checked", "false");
        }    
    });    
});

It used to work in jQuery 1.4.xx but today I upgraded to JQuery 1.8.1 and it no longer works. What should I need to get it working again?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:32:59+00:00Added an answer on June 10, 2026 at 4:32 pm

    This is all you should need:

    $("#chkAll").click(function () {
        var checkAll = $(this).prop("checked");
        $("#<%= gvStudents.ClientID %> :checkbox").not(this).prop("checked", checkAll);
    });   
    

    Live example: http://jsfiddle.net/3ZfzS/

    But to make this more intuative, you should probably uncheck the “checkAll” checkbox when one or more of the others are unchecked. This could be done with this addition:

    $("#<%= gvStudents.ClientID %> :checkbox").not('#chkAll').click(function(){
        var total = $("#<%= gvStudents.ClientID %> :checkbox").not('#chkAll').size();
        var checked = $("#<%= gvStudents.ClientID %> :checkbox").not('#chkAll').filter(':checked').size();
        $("#chkAll").prop("checked",total == checked);
    });
    

    Live example: http://jsfiddle.net/xV2ej/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display the grid view like this -(fig 1) Sr.no Class ----Division------
I have a view which lists students. I want to add a delete icon(
I am listing students at my web page. I want to list their information
I am outputting a students logged problems by passing the student into the view
We are two students who want to use one-class svm for dectection of summary
I am creating a small game for students, and in a place, it has
My students all have a Google account, but use different emails (like john@hotmail.com).I tried
I have data of students from several schools. I want to show a histogram
I have a gridview that I want to read, delete, edit and update, I
Students can be in many different classes. Each class has many different student. A

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.