Results 1 to 2 of 2

Thread: [RESOLVED] how to select text from a cell in datagrid

  1. #1

    Thread Starter
    Junior Member swapnil.k's Avatar
    Join Date
    Nov 2011
    Location
    India
    Posts
    17

    Resolved [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.

  2. #2

    Thread Starter
    Junior Member swapnil.k's Avatar
    Join Date
    Nov 2011
    Location
    India
    Posts
    17

    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
  •  



Click Here to Expand Forum to Full Width