Victor Charles
asked on
Help with selecting all rows in a DataGrid
Hi,
My DataGrid contains two columns a checkbox column from code below and a country column. How do I select all the rows including checkboxes from a button click event using VB.NET?
Private Sub CheckControl()
Dim CheckBoxCol As New DataGridViewCheckBoxColumn
With CheckBoxCol
.Name = "CheckBoxColumn"
.HeaderText = "Select"
.Width = 40
End With
Me.C1TrueDBGrid3.Columns.I nsert(0, CheckBoxCol)
End Sub
Thanks,
Victor
My DataGrid contains two columns a checkbox column from code below and a country column. How do I select all the rows including checkboxes from a button click event using VB.NET?
Private Sub CheckControl()
Dim CheckBoxCol As New DataGridViewCheckBoxColumn
With CheckBoxCol
.Name = "CheckBoxColumn"
.HeaderText = "Select"
.Width = 40
End With
Me.C1TrueDBGrid3.Columns.I
End Sub
Thanks,
Victor
ASKER
Hi,
I would like all the check boxes to have a check placed in them and change their back color to blue.
Thanks.
I would like all the check boxes to have a check placed in them and change their back color to blue.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You, will try it and get back to you.
OK
ASKER
Thank You.
Not a problem Victor, glad to help.
When you say, "How do I select all the rows including checkboxes from a button click event using VB.NET?", do you mean that all the row become a member of the Selected collection of the DataGridView or that all the check boxes have a check placed in them?