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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:21:46+00:00 2026-05-27T19:21:46+00:00

This question is similar to this question , bit the big difference is that

  • 0

This question is similar to this question, bit the big difference is that the CheckBoxList is in the FormTemplate of a Telerk’s RadGrid.

I tried this approaches, but they don’t work:

Check/Uncheck all Items in an ASP.NET CheckBox List using jQuery

Java Script for checkbox list in grid’s editformsettings

Here’s my code:

<telerik:RadGrid ID="RadGrid1" runat="server" ... >
   ...
   <MasterTableView ...>
      ...
      <EditFormSettings EditFormType="Template">
         <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
         <FormTemplate>
            <table class="edit-table-rad" cellspacing="2" cellpadding="1" width="100%" border="0">
               ...
               <tr>
                  <td align="left" width="200px">
                     <b>Languages:</b><br />
                     <asp:CheckBox ID="chbSelectAllLanguage" runat="server" 
                                   Text="Select All"
                                   ClientIDMode="Static"/>
                  </td>
                  <td>
                     <asp:CheckBoxList ID="cblLanguage" runat="server" 
                                       DataSourceID="entityDataSourceLanguage"
                                       DataTextField="LanguageName"
                                       DataValueField="LanguageID"
                                       RepeatColumns="4">
                     </asp:CheckBoxList>
                  </td>
               </tr>
               ...
            </table>
         </FormTemplate>
      </EditFormSettings>
   </MasterTableView>
</telerik:RadGrid>

The examples above use jQuery to get the CheckBox and add a click function. But I can’t get the CheckBox. I tried getting it by the ID and by a cssclass, but I think that the CheckBox in the RadGrid’s FormTemplate is not in the DOM at document.ready time.

Is there a way to select/deselect all CheckBoxList items by selecting/deselecting the single CheckBox?

EDIT AFTER COMMENT

I can’t find the HTML of the FormTemplate before I open the edit form. When the form is open, the HTML is this:

<tr>
<td width="200px" align="left">
    <b>Languages:</b>
    <br>
    <span class="chbSelectAllLanguage">
        <input id="chbSelectAllLanguage" type="checkbox" name="ctl00$MainContent$rgSurvey$ctl00$ctl02$ctl04$chbSelectAllLanguage">
        <label for="chbSelectAllLanguage">Select All</label>
    </span>
</td>
<td>
    <table id="ctl00_MainContent_rgSurvey_ctl00_ctl02_ctl04_cblLanguage" class="kipCheckBoxList">
        <tbody>
            <tr>
                //the CheckBoxList generated data, like this:
                <td>
                    <input id="ctl00_MainContent_rgSurvey_ctl00_ctl02_ctl04_cblLanguage_0" type="checkbox" value="1" name="ctl00$MainContent$rgSurvey$ctl00$ctl02$ctl04$cblLanguage$0">
                    <label for="ctl00_MainContent_rgSurvey_ctl00_ctl02_ctl04_cblLanguage_0">English</label>
                </td>
                ...
            </tr>
            ...
        </tbody>
    </table>
</td>

  • 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-27T19:21:47+00:00Added an answer on May 27, 2026 at 7:21 pm

    I found the answer! The trick was to put the <script> tag inside an <telerik:RadCodeBlock ID="RadCodeBlock" runat="server"> tag, and then add this code to the ItemDataBound event od the RadGrid:

    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
       GridEditableItem geiItem = e.Item as GridEditableItem;
       CheckBox chbSelectAllLanguage = geiItem.FindControl("chbSelectAllLanguage") as CheckBox;
       CheckBoxList cblLanguage = geiItem.FindControl("cblLanguage") as CheckBoxList;
       chbSelectAllLanguage.Attributes.Add("onclick", "javascript:SelectDeselect('" + chbSelectAllLanguage.ClientID + "','" + cblLanguage.ClientID + "')");
    }
    

    Then the function for selectin/deselecting is like this:

    <telerik:RadCodeBlock ID="RadCodeBlock" runat="server">
       <script type="text/javascript">
          function SelectDeselect(chk, chklst) {
             var isChecked = $('#' + chk).is(':checked');
             $("[id^=" + chklst + "]").each(function () {
                 $(this).attr("checked", isChecked);
             });
          }
       </script>
    </telerik:RadCodeBlock>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is similar to this other one , with the difference that the
My question is very similar to this question but a bit more specific. My
I already asked a similar question but this one is a bit different/specific: I'm
I realize that there was a similar question asked here , but this is
This question is similar to GWT Table that supports sorting, scrolling and filtering However
I know this question is similar to several previous ones, but I can't find
This question is similar to this one , but hopefully it will pick up
Sorry if the question is bit confusing. This is similar to this question I
I have asked a similar question to this one already but I think it
I've looked at various Q&As on SO similar to this question but haven't found

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.