Results 1 to 2 of 2

Thread: Return value from a Grid

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Posts
    49

    Return value from a Grid

    How do I return the value of the field in the 1st column of a grid from a row that a user selects on the grid. Let's say row 3 column 1's field value is "APPLE". How do I store "APPLE" to a
    variable like objgriditem so I can use that value to search another table for that value? I tried returning the value like this....

    Dim objGridItem As GridItem

    objGridItem = CType(AssetGrid1.Item(AssetGrid1.CurrentCell.RowNumber, 1), GridItem)

    but it does not work.

    Thanks,

    FoxT

  2. #2

    Thread Starter
    Member
    Join Date
    Mar 2004
    Posts
    49

    Found a solution

    Ok, I got it to work this way.

    Protected AssetDS As New DataSet
    Private dtAsset As DataTable
    Private dvAsset As DataView
    _____________________________________

    dtAsset = AssetDS.Tables(0)
    dvAsset = dtAsset.DefaultView

    Dim strCurrentID As String = dvAsset(AssetGrid1.CurrentRowIndex)("ID").ToString

    FoxT

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