Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

get position in datagrid with tabindexchange function

Posted on 2006-11-15
2
Medium Priority
?
552 Views
Last Modified: 2012-08-13
How can I get the position of in the datagrid using the tabindexchange function.  Thanks

Private Sub DataGrid1_TabIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.TabIndexChanged
        Dim x, y
       

        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)
            DataGrid1.Item(hti.Row, 0) = recordid 'Column 1
        End If
    End Sub
0
Comment
Question by:running32
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
Hillwaaa earned 2000 total points
ID: 17951162
Hi running32,

Are you sure you want the TabIndexChanged function?  This is triggered when the TabIndex value of the DataGrid is changed - i.e. the order in which you tab to the DataGrid in the form changes - not when you hit the tab key within the DataGrid.

Assuming that you are trying to find the position of the current cell in the datagrid with the tab key is pressed, then use:
Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.CurrentCellChanged
    MessageBox.Show("row: " & DataGrid_workEntries.CurrentCell.RowNumber)
End Sub

Let me know if my assumption was wrong!!

Cheers!
0
 

Author Comment

by:running32
ID: 17958367
Great, thanks
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question