Checkbox dans le header du datagridview
Bonjour,
j'ai essayer de mettre ce code dans l'événement cellpainting du datagridview pour avoir un header de type checkbox
Code:
1 2 3 4 5 6 7
|
dim chkBox as checkbox = New CheckBox()
Dim rect As Rectangle = Me.DataGridView2.GetCellDisplayRectangle(0, -1, True)
chkBox.Size = New Size(18, 18)
Dim positionChk As Point = New Point(rect.Location.X + 14, rect.Location.Y + 10)
chkBox.Location = positionChk
Me.DataGridView2.Controls.Add(chkBox) |
Comment je peux récupérer la valeur booléen si la case à cocher du header est cocher ou décocher ?
Merci d'avance.