Solved

Datagridview

Posted on 2013-06-13
3
257 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
  • 2
3 Comments
 
LVL 42

Expert Comment

by:sedgwick
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:
sedgwick earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now