Try this
Private Sub DataGridView1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DataGridView1.KeyUp
If Keys.Enter Then
Dim _Dt As DataTable = Me.DataGridView1.DataSource
If _Dt IsNot Nothing Then
Dim _NewRow As System.Data.DataRow = _Dt.NewRow
_Dt.Rows.Add(_NewRow)
Me.DataGridView1.DataSource = _Dt
_NewRow = Nothing
_Dt.Dispose()
_Dt = Nothing
End If
End If
End Sub
Last edited by 4advanced; Apr 28th, 2009 at 7:16 am.
Reputation Points: 33
Solved Threads: 10
Junior Poster in Training
Offline 67 posts
since Nov 2008