Checking All CheckBoxes in a DatagridView
Posted on 2006-07-21
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 addSelectedForPrintingColumn()
Dim column As New DataGridViewCheckBoxColumn()
.HeaderText = "For Printing"
.Name = "colSelectForPrinting"
.Width = 110
.FlatStyle = FlatStyle.Standard
.CellTemplate = New DataGridViewCheckBoxCell()
.CellTemplate.Style.BackColor = Color.Blue