Link to home
Start Free TrialLog in
Avatar of wmetz
wmetz

asked on

Getting the Value from a Cell in a DataGrid

This is a easy one if you know your DataGrids.

I currently have a ADO Data Control 6.0 and a DataGrid Control 6.0 on one of my forms.

I am trying to access the value of a single cell in the Activity_ID field when the cursor is next to it.

The only way I have figured out how to do this so far is through the use of bookmarks as the Initial Query loads I make every row a bookmark.

Ex.  
 For I = 0 To DataGrid1.VisibleRows - 1
   DataGrid1.SelBookmarks.Add (DataGrid1.RowBookmark(I))
 Next I



 I click a Command Button coded as.....
Ex.

Dim intENum

intENum =
DataGrid1.Columns(0).CellValue(DataGrid1.SelBookmarks(I))

Label6.Caption = intENum
 


So, MY QUESTION is,  can you get this value without the use of bookmarks????

Thank you so much for whoever answers this.

Avatar of nomulap
nomulap

This is how you do it

    intENum = adodc1.recordset("Activity_ID").value


ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi wmetz@devx,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Split points between: nomulap and acperkins@devx

wmetz@devx, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
Per recommendation, force-accepted.

Netminder
CS Moderator

nomulap: points for you at https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20328655