foobarr
asked on
Checking All CheckBoxes in a DatagridView
Basically I have a datagridview that shows some information on an order and I want to check the box I want to print. So when I hit my print button it will check all the rows that are selected and print them...
The problem I am having is figuring out how to select all. What I want to do it select the Header Text at the top of the column and when i click that withthe mouse it will make the checkboxes in its column all set to checked
Here is how I added the checkbox to the datagridview
Private Sub addSelectedForPrintingColu mn()
Dim column As New DataGridViewCheckBoxColumn ()
With column
.HeaderText = "For Printing"
.Name = "colSelectForPrinting"
.Width = 110
.FlatStyle = FlatStyle.Standard
.CellTemplate = New DataGridViewCheckBoxCell()
.CellTemplate.Style.BackCo lor = Color.Blue
End With
dgvDocketInformation.Colum ns.Insert( 0, column)
End Sub
The problem I am having is figuring out how to select all. What I want to do it select the Header Text at the top of the column and when i click that withthe mouse it will make the checkboxes in its column all set to checked
Here is how I added the checkbox to the datagridview
Private Sub addSelectedForPrintingColu
Dim column As New DataGridViewCheckBoxColumn
With column
.HeaderText = "For Printing"
.Name = "colSelectForPrinting"
.Width = 110
.FlatStyle = FlatStyle.Standard
.CellTemplate = New DataGridViewCheckBoxCell()
.CellTemplate.Style.BackCo
End With
dgvDocketInformation.Colum
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.