By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,417 Members | 1,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,417 IT Pros & Developers. It's quick & easy.

Key Press Event in datagridview

P: 1
I just want to be when I press key in my DataGridView then instead of which row I was selected the next row was selected and this information will transfer to the another pages.

For code examples
Expand|Select|Wrap|Line Numbers
  1. Private Sub DGV1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles DGV1.KeyPress
  2.         If (DGV1.Rows.Count > 0) Then
  3.             If (DGV1.SelectedRows.Count > 0) Then
  4.                 If (Keys.Enter) Then
  5.                     Dim inv_no = DGV1.CurrentRow.Cells(1).Value.ToString()
  7.                     book_n_measure.TB1.Text = inv_no
  9.                 End If
  11.             End If
  12.         End If
  14.         book_n_measure.TB1.Focus()
  16. End Sub

In this book_n_measure is page where i want to transfer my value in tb1 TextBox and dgv1 is the DatagGridView.
Jun 7 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.