Trucos de Visual Basic.NET Datagrid. Seleccionar toda la fila al hacer click


Para poder seleccionar toda la fila de un grid al hacer click encima utilizaremos la siguiente función:

Private Sub DgUrls_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DgUrls.MouseUp
Dim pt As System.Drawing.Point
pt = New Point(e.X, e.Y)

Dim hti As DataGrid.HitTestInfo
hti = DgUrls.HitTest(pt)
If hti.Type = DataGrid.HitTestType.Cell Then
DgUrls.CurrentCell = New DataGridCell(hti.Row, hti.Column)
DgUrls.Select(hti.Row)
End If
End Sub

Donde DgUrls es el nombre del datagrid

Dejar un comentario

Nombre:

Mail:

Web:

Comentario:

Trucos relacionados de Datagrid. Seleccionar toda la fila al hacer click