|
-
March 20th, 2006, 04:19 PM
#1
Datagrid: Selecting a cell will automatically select the row
If my datagrid has several columns and the user selects a cell in one of those columns, is there a way for it to select the whole row and not just the selected cell? I'm sure there is a way to test which cell was selected, then from that data, you can make the row selected. The question is how?
-
March 21st, 2006, 07:32 AM
#2
Re: Datagrid: Selecting a cell will automatically select the row
In mouse upe event of the grid u can write
Dim pt As Point = New Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo = dgSuppliesRecords.HitTest(pt)
If hti.Type = DataGrid.HitTestType.Cell Then
DataGridName.CurrentCell = New DataGridCell(hti.Row, hti.Column)
DataGridName.Select(hti.Row)
End If
HTH
-
March 21st, 2006, 11:13 AM
#3
Re: Datagrid: Selecting a cell will automatically select the row
Thank you that worked beautifully. All I had to do was fill in the function:
Code:
Private Sub DataGrid1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseUp
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|