Bonjour,
  J'ai trouvé ce code qui me permet de cocher toutes les chexbox de mon GridView, mais je ne veux cocher qu'une seule colonne à la fois! Comment puis-je faire? Les colonnes sont implémentées dans un GridView.
	
	| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 
 | <script type="text/javascript" language="javascript">
function SelectAllCheckboxes(spanChk){
    // Added as ASPX uses SPAN for checkbox
    var oItem = spanChk.children;
    var theBox=(spanChk.type=="checkbox")?spanChk:spanChk.children.item[0];
    xState=theBox.checked;
    elm=theBox.form.elements;
    for(i=0;i<elm.length;i+=3){
        if(elm[i].type=="checkbox" && elm[i].id!=theBox.id)
        {
            //elm[i].click();
            if(elm[i].checked!=xState)
            elm[i].click();
            //elm[i].checked=xState;
        }
    }
}
</script> | 
 
	
	<input id="chkAll" type="checkbox" onclick="SelectAllCheckboxes(this)">
 
						
					
Partager