DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Radhika Nair Guest

    Trapping Keydown event in Datagrid

    Hi !

    I would like to be able to write an event handler for the DataGrid.KeyDown
    event. I have set the Form.KeyPreview = True and have written the following
    event handler:

    Private Sub DataGrid_Test_KeyDown(ByVal sender As System.Object, ByVal e As
    KeyEventArgs) Handles DataGrid_Test.KeyDown

    MessageBox.Show("Key Pressed = " & e.KeyData.ToString())

    End Sub

    I would expect that when any key is pressed in the DataGrid, the messagebox
    will be displayed. But this is not happening.

    Any help would be appreciated.

    Thanks,
    Radhika






  2. #2
    VBDotNet Team [MS] Guest

    Re: Trapping Keydown event in Datagrid

    Hi Radhika - There is a great example on syncfusion.com of how to handle
    keystrokes in the datagrid:

    http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q755q

    Hope this helps!
    -- Mike
    VB .NET Team

    --
    This posting is provided "AS IS" with no warranties, and confers no rights.

    "Radhika Nair" <radhikan@first-insight.com> wrote in message
    news:3d4af9b4@10.1.10.29...
    > Hi !
    >
    > I would like to be able to write an event handler for the DataGrid.KeyDown
    > event. I have set the Form.KeyPreview = True and have written the

    following
    > event handler:
    >
    > Private Sub DataGrid_Test_KeyDown(ByVal sender As System.Object, ByVal e

    As
    > KeyEventArgs) Handles DataGrid_Test.KeyDown
    >
    > MessageBox.Show("Key Pressed = " & e.KeyData.ToString())
    >
    > End Sub
    >
    > I would expect that when any key is pressed in the DataGrid, the

    messagebox
    > will be displayed. But this is not happening.
    >
    > Any help would be appreciated.
    >
    > Thanks,
    > Radhika
    >
    >
    >
    >
    >




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links