Results 1 to 3 of 3

Thread: KeyEvent on DataGrid

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    3

    Question KeyEvent on DataGrid

    Hi all,

    I am using DataGrid in VB.Net. The problem is that I want to show the detail information of a row when ever the user double clicks a row on press Enter on a row when a row was selected. It seems to me that the KeyDown or KeyPress events do not work.
    Please help me with some sample code. It's urgent.

    Thank you very much

    longnh0702

  2. #2
    Registered User jkw119's Avatar
    Join Date
    Oct 2001
    Location
    Pittsburgh
    Posts
    256
    try this....

    VB Code:
    1. Private Sub DataGrid1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.Click
    2. Dim x As Integer
    3. For x = 0 To (EndofFile)
    4.      If Me.DataGrid1.IsSelected(x) Then
    5.                 'do whatever you want with the row that was double clicked
    6.      End If
    7. Next
    8. End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    3

    KeyPress on DataGrid

    Thank you very much,
    How can I catch the event of pressing Enter on the DataGrid ?
    Please tell me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width