Link to home
Start Free TrialLog in
Avatar of foobarr
foobarrFlag for Canada

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 addSelectedForPrintingColumn()
        Dim column As New DataGridViewCheckBoxColumn()
        With column
            .HeaderText = "For Printing"
            .Name = "colSelectForPrinting"
            .Width = 110

            .FlatStyle = FlatStyle.Standard
            .CellTemplate = New DataGridViewCheckBoxCell()
            .CellTemplate.Style.BackColor = Color.Blue


        End With

        dgvDocketInformation.Columns.Insert(0, column)
    End Sub
ASKER CERTIFIED SOLUTION
Avatar of Mystify
Mystify

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial