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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
All Courses

From novice to tech pro — start learning today.