Solved

Datagridview

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 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

18 Experts available now in Live!

Get 1:1 Help Now