[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?
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