Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Datagridview

Posted on 2013-06-13
3
Medium Priority
?
264 Views
Last Modified: 2013-06-13
tbxdescription.Text = dgridtitle.SelectedRows(0).Cells(0).Value

Open in new window


The above code works fine. But instead of passing cells(0) i need to pass column name like
tbxdescription.Text = dgridtitle.SelectedRows(0).Cells(TitleID).Value

Open in new window


How can I do this ?
0
Comment
Question by:GRChandrashekar
[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
  • 2
3 Comments
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 39243677
so replace TitleID with the column name.
what is the problem?
0
 

Author Comment

by:GRChandrashekar
ID: 39243682
This syntax is wrong
gridtitle.SelectedRows(0).Cells(TitleIdID).Value
0
 
LVL 42

Accepted Solution

by:
Meir Rivkin earned 2000 total points
ID: 39243714
what type is TitleIdID?
here's an example to get the column "id" in the first row:
Dim val = dgv.SelectedRows(0).Cells("id").Value

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

597 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