?
Solved

How to select a value in the selected row?

Posted on 2008-10-12
7
Medium Priority
?
214 Views
Last Modified: 2012-05-05
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
Comment
Question by:Tom Sage
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 8

Expert Comment

by:tiagosalgado
ID: 22698847
Try DataGridView1.SelectedRows(0).Cells(0).Value
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22698933
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
 
LVL 48

Expert Comment

by:jpaulino
ID: 22698941
<please ignore this comment>
Olá Tiago,
Ainda bem que vejo mais um Português por aqui.
Um abraço
</please ignore this comment>
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 8

Expert Comment

by:tiagosalgado
ID: 22699005
<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
 

Author Comment

by:Tom Sage
ID: 22699510
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
 
LVL 48

Accepted Solution

by:
jpaulino earned 2000 total points
ID: 22699524
That way you can use:


Debug.WriteLine(DataGridView1.CurrentRow.Cells(0).Value)
0
 

Author Closing Comment

by:Tom Sage
ID: 31505499
Thank you for your quick answer.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question