cs_tortuedu74
Messages postés99Date d'inscriptionvendredi 23 mars 2007StatutMembreDernière intervention27 mai 2009
-
18 mai 2009 à 13:48
cs_tortuedu74
Messages postés99Date d'inscriptionvendredi 23 mars 2007StatutMembreDernière intervention27 mai 2009
-
18 mai 2009 à 14:03
Bonjour,
Je ne suis pas loin de ma solution mais j'ai besoin d'un petit coup de main:
J'ai un gridview, dans chaque cellule de la colonne 1, j'ai des checkbox, avec en entête une checkbox pour cocher toutes les autres.
voici ou j'en suis:
dans ma fonction checkall_checkedchanged(...)
Dim showCheckBox As System.Web.UI.WebControls.CheckBox = CType(sender, System.Web.UI.WebControls.CheckBox)
If showCheckBox.Checked Then
Dim ICheckbox As System.Web.UI.WebControls.CheckBox
MsgBox("checké")
For index = 0 To GridView1.Rows.Count - 1
MsgBox(GridView1.Rows(index).Cells(1).Controls(1).GetType.Name)
Next
Else
MsgBox("no checké")
End If
J'ai bien le type de ma cellule qui s'affiche, je sais que c'est une checkbox, mais comment lui faire cocher mes checkbox?
cs_tortuedu74
Messages postés99Date d'inscriptionvendredi 23 mars 2007StatutMembreDernière intervention27 mai 2009 18 mai 2009 à 14:03
Bon ben en fait j'ai trouvé... après 3 jours....
La solution si ça peut intéresser quelqu'un:
Dim showCheckBox As System.Web.UI.WebControls.CheckBox = CType(sender, System.Web.UI.WebControls.CheckBox)
Dim ICheckbox As System.Web.UI.WebControls.CheckBox
' Show or hide the rows of the GridView control based
' on the check box value selected by the user.
If showCheckBox.Checked Then
For index = 0 To GridView1.Rows.Count - 1
If (GridView1.Rows(index).Cells(1).Controls(1).GetType.Name = "CheckBox") Then
ICheckbox = CType(GridView1.Rows(index).Cells(1).Controls(1), System.Web.UI.WebControls.CheckBox)
ICheckbox.Checked = True
End If
Next
Else
For index = 0 To GridView1.Rows.Count - 1
If (GridView1.Rows(index).Cells(1).Controls(1).GetType.Name = "CheckBox") Then
ICheckbox = CType(GridView1.Rows(index).Cells(1).Controls(1), System.Web.UI.WebControls.CheckBox)
ICheckbox.Checked = False
End If
Next
End If