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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:58:24+00:00 2026-05-25T01:58:24+00:00

I have a grid with a few items which have a checkbox at the

  • 0

I have a grid with a few items which have a checkbox at the start of each row. I also have a select all checkbox at the top of the grid. The scenario is something like our gmail or yahoo inbox. My question is, suppose i disable a checkbox and then click on select all checkbox, the disabled checkbox should not be checked. Is there any solution for this? I have attached relevant pieces of code as follows.

*aspx file

<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">

     <HeaderTemplate>

         <asp:CheckBox id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox>

     </HeaderTemplate>

     <ItemTemplate>

         <asp:CheckBox id="CheckBox1" OnCheckedChanged="ToggleRowSelection" AutoPostBack="True"  runat="server"></asp:CheckBox>

     </ItemTemplate>

</telerik:GridTemplateColumn>

*code behind

 protected void ToggleRowSelection(object sender, EventArgs e) //selecting a particular row

    {
        ((sender as CheckBox).NamingContainer as GridItem).Selected = (sender as CheckBox).Checked;

    }

    protected void ToggleSelectedState(object sender, EventArgs e) //select all rows

    {

        CheckBox headerCheckBox = (sender as CheckBox);

        foreach (GridDataItem dataItem in grdCurrent.MasterTableView.Items)

        {

            (dataItem.FindControl("CheckBox1") as CheckBox).Checked = headerCheckBox.Checked;

            dataItem.Selected = headerCheckBox.Checked;

        }

    }
  • 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-05-25T01:58:25+00:00Added an answer on May 25, 2026 at 1:58 am

    You need to check if it is Enabled before setting it to Checked.

    CheckBox headerCheckBox = (sender as CheckBox);
    
    foreach (GridDataItem dataItem in grdCurrent.MasterTableView.Items)
    {
      if((dataItem.FindControl("CheckBox1") as CheckBox).Enabled) // add this condtion
      {
        (dataItem.FindControl("CheckBox1") as CheckBox).Checked = headerCheckBox.Checked;
        dataItem.Selected = headerCheckBox.Checked;
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the scenario I have a Grid with some TextBlock controls, each in a
Suppose I have a grid with some row definitions, and a child control in
I have a data grid that has a checkbox item renderer in a cloumn
I have a UserControl which contains a listbox and few buttons. <UserControl x:Class=ItemControls.ListBoxControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
I have a Listbox that is filled with 30,000 elements <ListBox Name=lbWordlist Grid.Row=1 Margin=10
So I have a few items in a list that I display on my
I have a form with a few text-boxes and a Grid-view. There is this
I have a grid laid out like so; +---------+---------+ | Image | Details |
I have an ExtJS grid on a web page and I'd like to save
I have a Property Grid in C#, loading up a 'PropertyAdapter' object (a basic

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.