• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

How to select a value in the selected row?

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

DataGridView.CurrentRow.Cells(0).Value

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

Thanks
0
Tom Sage
Asked:
Tom Sage
  • 3
  • 2
  • 2
1 Solution
 
tiagosalgadoCommented:
Try DataGridView1.SelectedRows(0).Cells(0).Value
0
 
jpaulinoCommented:
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

0
 
jpaulinoCommented:
<please ignore this comment>
Olá Tiago,
Ainda bem que vejo mais um Português por aqui.
Um abraço
</please ignore this comment>
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
tiagosalgadoCommented:
<please ignore this comment too>
Olá Jorge,
É verdade, já tinha visto que tb andas por cá.
Um abraço
</please ignore this comment too>
0
 
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
0
 
jpaulinoCommented:
That way you can use:


Debug.WriteLine(DataGridView1.CurrentRow.Cells(0).Value)
0
 
Tom SageAuthor Commented:
Thank you for your quick answer.
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now