How to select a value in the selected row?

How can I select the row pointed to by the arrow in the left column?  I have tried this code:


but it does not select the row that the arrow in the left column is pointing to.  

Tom SageAsked:
Who is Participating?
Jorge PaulinoConnect With a Mentor IT Pro/DeveloperCommented:
That way you can use:

Try DataGridView1.SelectedRows(0).Cells(0).Value
Jorge PaulinoIT Pro/DeveloperCommented:
If you want to select the row (with the arrow on the left column) you can do this:

        Dim col As Integer = 2
        Me.DataGridView1.CurrentCell = Me.DataGridView1(0, col)

Open in new window

The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Jorge PaulinoIT Pro/DeveloperCommented:
<please ignore this comment>
Olá Tiago,
Ainda bem que vejo mais um Português por aqui.
Um abraço
</please ignore this comment>
<please ignore this comment too>
Olá Jorge,
É verdade, já tinha visto que tb andas por cá.
Um abraço
</please ignore this comment too>
Tom SageAuthor Commented:
I think I did not explain exactly what I need.  

I need the value of cell zero on the row on which the arrow is currently pointing.  I do not need to select the row.

Thank you
Tom SageAuthor Commented:
Thank you for your quick answer.
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.

All Courses

From novice to tech pro — start learning today.