Solved

Datagridview

Posted on 2013-06-13
3
260 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

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

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

726 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