Hi,
I wanted to ask anyone if they have done anything silimar to this...
I have the following code to highlight the entire row when any cell of the datagrid is clicked...
Private Sub DGrid1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DGrid1.MouseUp
'code to select whole line from the datagrid when any cell is clicked
Dim pt = New Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo = DGrid1.HitTest(pt)
If hti.Type = DataGrid.HitTestType.Cell Then
DGrid1.CurrentCell = New DataGridCell(hti.Row, hti.Column)
DGrid1.Select(hti.Row)
End If
End Sub
The Datagrid contains the results of a query that is run against my database.
What i wanted to do is when the user highlights a row in the way shown above, i need to retrieve the value that is stored in the first column of that specific row. I then want this value to be put into a variable so that i can use it as a parameter for a delete query.
Is this possible??
I am using VS.NET 2002 and am creating a windows app using VB.NET
Can anyone plz help me to try and solve this problem?
I wanted to ask anyone if they have done anything silimar to this...
I have the following code to highlight the entire row when any cell of the datagrid is clicked...
Private Sub DGrid1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DGrid1.MouseUp
'code to select whole line from the datagrid when any cell is clicked
Dim pt = New Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo = DGrid1.HitTest(pt)
If hti.Type = DataGrid.HitTestType.Cell Then
DGrid1.CurrentCell = New DataGridCell(hti.Row, hti.Column)
DGrid1.Select(hti.Row)
End If
End Sub
The Datagrid contains the results of a query that is run against my database.
What i wanted to do is when the user highlights a row in the way shown above, i need to retrieve the value that is stored in the first column of that specific row. I then want this value to be put into a variable so that i can use it as a parameter for a delete query.
Is this possible??
I am using VS.NET 2002 and am creating a windows app using VB.NET
Can anyone plz help me to try and solve this problem?