|
-
Nov 23rd, 2011, 12:58 PM
#1
Thread Starter
Junior Member
[RESOLVED] how to select text from a cell in datagrid
hi,
I am using vb6.
On form1, I have created a datagrid using ADODC which displays id, name, region, cost, amount..
when user highlights a row and clicks select button, i want vb to select text from selected row and "name" column (i.e. i want vb to select the name from datagrid) and display it in form2.
can anyone plz help me?
Last edited by swapnil.k; Nov 23rd, 2011 at 01:10 PM.
-
Nov 23rd, 2011, 01:31 PM
#2
Thread Starter
Junior Member
Re: how to select text from a cell in datagrid
Resolved... here's the solution
1) Get a reference to the column of interest. For example, if the column that you are interested in is a field named "Price" then, the following line will retrieve a reference:
Dim gCol as MSDataGridLib.Column
Set gCol = DataGrid1.Columns("Price")
2) Now lets display the contents of the Price value in the first row.
OR
'Please replace the both double quote marks below with an opening and a closing parentheses.
Label1 = gcol.lCellValue"RowBookmark(0)"
OR
DataGrid1.Columns(1).Value
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|