DataGrid Question

When a user double clicks on a particular row inside a DataGrid how can I capture the values in the first three cells of that row the user clicked on?
PeterErhardAsked:
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.

davidrichardsonCommented:
Add the following to the datagrid click event

 Dim S As Integer
  S= Datagrid1.CurrentCell.RowNumber
        Datagrid1.Item(r, 0)  
        Datagrid1.Item(r, 1)  
        Datagrid1.Item(r, 2)

What do you want do do with them ?
0
PeterErhardAuthor Commented:
Thanks for that. I want to transfer the values to text boxes.
0
davidrichardsonCommented:
Just Use

Dim S As Integer
  S= Datagrid1.CurrentCell.RowNumber
        Txtbox1 = Datagrid1.Item(r, 0)  
        Txtbox2 = Datagrid1.Item(r, 1)  
        Txtbox3 = Datagrid1.Item(r, 2)
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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

PeterErhardAuthor Commented:
Thanks - will try it out.
0
davidrichardsonCommented:
You probably worked it out but it should be

Txtbox1.TEXT
0
davidrichardsonCommented:
The datagrid double click event isnt the best there is, i found this very usefull

http://dotnetjunkies.com/WebLog/demiliani/archive/2004/02/16/7338.aspx
0
PeterErhardAuthor Commented:
Had already figured that out but thanks a lot.
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.