Pre-defining a DataGridView Column Type?

In the below SubProcedure, I need to define the CellType for each column. I'm just not sure how to do that. Column 4 needs to be a DataGridViewCheckBoxColumn while the rest can be DataGridViewTextBoxCells.

    Private Sub FormatGridRuns(ByVal uc As userLoad)

            EH.ErrorMessage = String.Empty

            uc.dgvLoadTests.Columns(0).HeaderText = "Test"
            uc.dgvLoadTests.Columns(1).HeaderText = "Run"
            uc.dgvLoadTests.Columns(2).HeaderText = "Direction"
            uc.dgvLoadTests.Columns(3).HeaderText = "Status"
            uc.dgvLoadTests.Columns(4).HeaderText = "Print On Cert"
            uc.dgvLoadTests.Columns(5).HeaderText = "loadLink_ID"
            uc.dgvLoadTests.Columns(6).HeaderText = "load_ID"
            uc.dgvLoadTests.Columns(7).HeaderText = "direction_ID"
            uc.dgvLoadTests.Columns(8).HeaderText = "angle_ID"
            uc.dgvLoadTests.Columns(9).HeaderText = "maxOutput"
            uc.dgvLoadTests.Columns(10).HeaderText = "maxNonLinearity"
            uc.dgvLoadTests.Columns(11).HeaderText = "maxHysteresis"

            uc.dgvLoadTests.Columns(5).Visible = False
            uc.dgvLoadTests.Columns(6).Visible = False
            uc.dgvLoadTests.Columns(7).Visible = False
            uc.dgvLoadTests.Columns(8).Visible = False
            uc.dgvLoadTests.Columns(9).Visible = False
            uc.dgvLoadTests.Columns(10).Visible = False
            uc.dgvLoadTests.Columns(11).Visible = False

        Catch ex As Exception
            EH.ErrorMessage = "frmCalibration_3/FormatGridRuns() - " & ex.Message & "...Contact Engineering!" & "~E"
        End Try
    End Sub

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
How are you defining the columns (run-time or design-time)?  If at design-time, then the designer has options to change the column type.  If you need to change the column type, you need to go back to the .designer.vb file, and change the column type to DataGridViewCheckBoxColumn.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BlakeMcKennaAuthor Commented:
Sorry...forgot about it!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.