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 7898495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:26:54+00:00 2026-06-03T08:26:54+00:00

i am using asp.net gridview in header i have two columns column select all

  • 0

i am using asp.net gridview in header i have two columns

column select all employee  | column select all employer

so i have two checkbox for two columns, so once it click on the select all employee it should only be selected for all employee and same goes with employer

but the below code is selecting both employee and employer if only select on employer.

function SelectAllCheckboxes(chk) {
        $('#<%=gv.ClientID%>').find("input:checkbox").each(function () {
            if (this != chk) { this.checked = chk.checked; }
        });
    }

    function SelectAllCheckboxes1(chk) {
        $('#<%=gv.ClientID%>').find("input:checkbox").each(function () {
            if (this != chk) { this.checked = chk.checked; }
        });
    }


<asp:CheckBox ID="chkAll" runat="server" onclick="javascript:SelectAllCheckboxes(this);" />

<asp:CheckBox ID="chkAll1" runat="server" onclick="javascript:SelectAllCheckboxes1(this);" />
  • 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-03T08:26:55+00:00Added an answer on June 3, 2026 at 8:26 am

    ASP – in your GridView:

    <asp:GridView id="gv" runat="server">
        <asp:TemplateField>
            <ItemTemplate>
                <asp:CheckBox id="cbxSelectEmployer" runat="server" CssClass="employer" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:CheckBox id="cbxSelectEmployee" runat="server" CssClass="employee" />
            </ItemTemplate>
        </asp:TemplateField>
    </asp:GridView>
    

    ASP – “Select all” checkboxes:

    <asp:CheckBox ID="chkAll" runat="server" onclick="SelectAllCheckboxes(this, '.employee')" />
    <asp:CheckBox ID="chkAll1" runat="server" onclick="SelectAllCheckboxes(this, '.employer')" />
    

    jQuery

    function SelectAllCheckboxes(chk, selector) {
        $('#<%=gv.ClientID%>').find(selector + " input:checkbox").each(function () {
            $(this).prop("checked", $(chk).prop("checked"));
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Asp.net and jQuery I have a GridView with a CheckBox column. Right now
I have an ASP.NET GridView control with two asp:CommandField columns that are both using
Using asp.net 3.5 Gridview control, visual studio 2008. I have played with all the
I'm currently counting all the checked checkboxes in an asp.net gridview using: $('#cphMain_gdvSalesOrder').delegate('input:checkbox', 'click',
I am using devexpress asp:GridView in asp.net with two columns: status and percentage The
I have a asp.net gridview where I hide and show columns using 'onclick' on
Using ASP.NET VB, I have a form with some text boxes and a Gridview.
I have an ASP.NET(2.0 using C#) web app, in which I have a gridview.
I've been using ASP.NET (C#) for the past two years. I have learned so
Using asp.net, c# 3.5, vs 2008. I have an aspx gridview called gv1 with

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.