Solved

URGENT!  VB.NET  DatagridView.KeyUp event not working properly

Posted on 2013-01-10
2
1,081 Views
Last Modified: 2013-01-11
Oracle Forms allows a user to execute a search or run a query when a user finishes typing a value in a column in a grid.  The user can press F8 on the keyboard to initiate the search based on the DataGrid's current column value.

I tried to use the DataGridView.KeyUp event to mimic the same function but the event does activate at the right time.  In fact, I have to click out of the column then click once, then hit F8.

Here is a snippet of the code I used

Select Case e.Keycode
      Case Keys.F8
             MyTableAdapter.Fill(Me.DataSet1.Table1, CurrentColumnValue)
End Select

After I type the last letter in the column and press F8, nothing happens-- but if I move to the next column and then click back on the original column, F8 works.

What am I doing wrong?

Thanks
0
Comment
Question by:eq2006
[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 14

Accepted Solution

by:
quizwedge earned 500 total points
ID: 38766315
Check out http://social.msdn.microsoft.com/Forums/en/winformsdatacontrols/thread/db486d50-48f3-405d-bc7a-ad3720d4dd57 There are both C# and VB solutions, though the solution from tbar68 (close to the bottom of the page) looks rather simple. You'd have to modify it a bit to catch the F8 key and the delete key.
0
 
LVL 7

Expert Comment

by:HaiFai
ID: 38766373
Hi

I have used this code to cap keys anywhere in form
  Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean
        Select Case keyData
            Case Keys.F2
                MsgBox("f2")
            Case Keys.F3
                MsgBox("f3")
            Case Keys.Escape
                MsgBox("esc")
            Case Else
                Return MyBase.ProcessCmdKey(msg, keyData)
        End Select
        Return True
    End Function

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

752 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