RETRIEVING TEXT FROM 1st COLUMN IN DATAGRID EVEN IF CLICKING IN OTHER COLUMN

In a ADO connected Datagrid I use first column as  Keyvalue to database,
by saying:   KEYVAL= datashow.text, problem comes when user clicks on 2 or 3 or higher column in grid then it returns .text from that column. I always need to know at the event
rowcolchange what is in first column of grid. How to extract from grid ????
BIAPROAsked:
Who is Participating?
 
bramsquadConnect With a Mentor Commented:
try this

Dim txt As String
Me.brokersgrid.Col = 1
txt = Me.brokersgrid.Text
0
 
jacobhooverCommented:
Are you using ASP.Net or just VB.Net?

In asp.net it would be something similar to:
  DataGrid.SelectedItem.Cells.Item(0).Text
0
 
jacobhooverCommented:
Err, make that:
DataGrid.SelectedItem.Cells.Item(1).Text

I think it's a base 1 array rather than base zero...
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
BIAPROAuthor Commented:
i am using VB6
0
 
bramsquadCommented:
in vb6

Dim txt As String = Me.MSDataGrid1.Col(1).Text

~b
0
 
BIAPROAuthor Commented:
did 2 ways to try Dim txt As String = Me.brokersgrid.Col(1).Text   gives error
and in 2 lines
Dim txt As String
txt = Me.brokersgrid.Col(1).Text
also error,

brokersgrid is my grid,  e.g.  txt = brokersgrid.text will give info on choosen columnn

is my syntax wrong for vb6   ?

0
 
BIAPROAuthor Commented:
yes !!!!!!!!
thanks
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.

All Courses

From novice to tech pro — start learning today.