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