943,582 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 268
  • VB.NET RSS
Apr 28th, 2009
0

query

Expand Post »
i am developing windows application project

i want that in a datagridview if there is data in the first row ,then i want that if i enter then that above row is copied as next row below the first row.so how i do code in enter of any cell in data gridview and generate next row
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
arunasingh is offline Offline
39 posts
since Dec 2008
Apr 28th, 2009
0

Re: query

Try this

VB.NET Syntax (Toggle Plain Text)
  1. Private Sub DataGridView1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DataGridView1.KeyUp
  2. If Keys.Enter Then
  3. Dim _Dt As DataTable = Me.DataGridView1.DataSource
  4. If _Dt IsNot Nothing Then
  5. Dim _NewRow As System.Data.DataRow = _Dt.NewRow
  6. _Dt.Rows.Add(_NewRow)
  7. Me.DataGridView1.DataSource = _Dt
  8.  
  9. _NewRow = Nothing
  10. _Dt.Dispose()
  11. _Dt = Nothing
  12.  
  13. End If
  14.  
  15. End If
  16. End Sub
Last edited by 4advanced; Apr 28th, 2009 at 7:16 am.
Reputation Points: 33
Solved Threads: 10
Junior Poster in Training
4advanced is offline Offline
67 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: WebBrowser Control through Hide-My-IP
Next Thread in VB.NET Forum Timeline: Update change data in DataGridView





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC