Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-01-10
2
Medium Priority
?
1,140 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:Eric Burton
[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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

705 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