troubleshooting Question

Data Grid Question

Avatar of running32
running32 asked on
Visual Basic.NET
2 Comments1 Solution275 ViewsLast Modified:
Can someone please tell me what  If hti.Type = DataGrid.HitTestType.Cell Then means.  I am trying to get which box was click in the datagrid.  I get coordinates for (e.X, e.Y) but when the program does not give me the cell.

Thanks



 Private Sub TextBoxMouseDownHandler(ByVal sender As Object, ByVal e As MouseEventArgs)
            Dim sFirst
            Dim sLast
                  MessageBox.Show("GridDoubleClick")
                Dim pt = New Point(e.X, e.Y)


                Dim hti As DataGrid.HitTestInfo = dataGrid1.HitTest(pt)

                If hti.Type = DataGrid.HitTestType.Cell Then

                    dataGrid1.CurrentCell = New DataGridCell(hti.Row, hti.Column)

                    dataGrid1.Select(hti.Row)
                    sFirst = dataGrid1.Item(hti.Row, 2)  'Column 2
                    sLast = dataGrid1.Item(hti.Row, 1)  'Column 2
                    MsgBox(sFirst & "  " & sLast)


                End If
                Console.WriteLine("TextBoxMouseDownHandler  ")


        End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros