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)
        'Debug.Print("FormatGridRuns")

        Try
            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

BlakeMcKennaAsked:
Who is Participating?
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.
0

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!
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.