Click here to Skip to main content
15,943,362 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
i have a grid view and in a grid view i have a check box. i want when i select any check box then only that particular check box is select and last selected check box is unselect. i want this using java script on aspx page. please suggest me code

use templete column checkbox list for gridview column and try this...

// Convert chkDateRange CheckBoxList Cheked Event as  RadioButton Checked Event.
       function ConvertToRadio(event) {
           var chkBoxCount = document.getElementById('<%= chkDateRange.ClientID %>').getElementsByTagName("input");
           for (i = 0; i < chkBoxCount.length; i++) {
               if (chkBoxCount[i].type == 'checkbox')
                   chkBoxCount[i].checked = false;
           if ( == null) {
               event.srcElement.checked = true;

           else {
      = true;
Share this answer
Refer this link if your intention was to select only one Checkbox per Gridview Row.


Or refer this if , wanted to Select the Single CheckBox column out of Multiple CheckBox columns

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900