How do I trap the enter key (and other keys) in an editable datagrid (NOT DATAGRIDVIEW!) control using VB.NET

Posted on 2009-05-01
Last Modified: 2013-12-17
Can anyone answer this w/example code?  There are hundreds of answers on the web, but they all pertain to a datagridview--not a datagrid.  I found one example using C#, but they don't specify which event is being overloaded--and there is NO 'KeyPress', 'KeyDown', "KeyUp' event listed in the DataGrid control.

Thanks in advance for your expertise!  Remember, this question is for VB.NET, but I figured there are prolly folks w/C# that also know...
Question by:louisiana_blues
    LVL 9

    Expert Comment


    With 2008 i do see the keyup, down events for the DataGrid.

    Dim test As New DataGrid

        Private Sub test_key(ByRef sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles test.KeyUp

    End Sub

    at the end after handles the KeyUp came from intelisense selection

    may that helps?
    Dim test As New DataGrid
        Private Sub test_key(ByRef sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles test.KeyUp
            If e.KeyCode = Keys.Enter Then ......
        End Sub

    Open in new window


    Author Comment

    Um, I appreciate the response, and I should have been clearer.  I am using .NET for web.  Not forms.  Anyone?  Please help!

    Author Comment

    I need to solve this before Monday!  Please help!!  I need an expert....

    Author Comment

    yikes.  experts exchange used to be really good resource.  I've now asked two seemingly simple questions, and not received one response in a week.  it's not worth the money if I end up talking to myself all the time.

    Accepted Solution

    Since this question has been open for a week, yet has rec'd zero answers, please delete this question.  I have one more open question...if I don't get an answer for it, I'm going to cnacel my subscription.  No point in paying for experts when they don't hang out here anymore--only people that make 'suggestions' until they happen to glom onto a correct solution.

    Delete this question please.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Help file 1 28
    VB.NET Server side Javascript 8 43
    Sending Text to device in .NET 9 19
    Merging PDFs with VB.NET 10 12
    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now