Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

Datagridview

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
GRChandrashekar
Asked:
GRChandrashekar
  • 2
1 Solution
 
Meir RivkinFull stack Software EngineerCommented:
so replace TitleID with the column name.
what is the problem?
0
 
GRChandrashekarAuthor Commented:
This syntax is wrong
gridtitle.SelectedRows(0).Cells(TitleIdID).Value
0
 
Meir RivkinFull stack Software EngineerCommented:
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
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.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now