Private Sub DataGrid3_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles DataGrid3.MouseDown
Try
Dim myGrid As DataGrid = CType(sender, DataGrid)
Dim hti As System.Windows.Forms.DataGrid.HitTestInfo
hti = myGrid.HitTest(e.X, e.Y)
Select Case hti.Type
Case System.Windows.Forms.DataGrid.HitTestType.Cell
If (hti.Column = 0) Then
If Not (hti.Row < 0) Then
Dim intDealNumber As Integer = CInt(DataGrid3.Item(hti.Row, hti.Column))
End If
End If
End Select
Cursor = Cursors.Default
Catch ex As Exception
Cursor = Cursors.Default
WriteErrortoLog(ex, "DataGrid3 Mouse Down", "Main", 0)
blValidationFlag = False
End Try
End Sub
"Fred Nelson" wrote:
Hi:
I have a VB.NET web app that contains a datagrid on a web form that is
loaded as follows:
DataGrid1.DataSource = lookup.searchnames(getinformation)
DataGrid1.DataBind
The grid displays data for the user and contains one column that is an html
link.
In some circumstances I would like to be able to read the values in the
DataGrid - for example I may want to read the first row:
Logically:
dim myval as integer = Datagrid1.Row(0).Col(0).value
Does anyone know how to do this from a DataGrid?
Thanks very much!
Fred