943,669 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 9575
  • VB.NET RSS
Feb 8th, 2009
0

Dynamically adding row to datagrid

Expand Post »
Is anyone have idea of how we add new row in datagrid I want to add DR and CR Column in datagrid view DataGrid View have 4 column Sr#, Discription, DR, CR

VB.NET Syntax (Toggle Plain Text)
  1. Dim DR As Decimal
  2. Dim CR As Decimal
  3.  
  4. DR = DataGridViewCashBook.Rows(index).Cells(4).Value.ToString()
  5. CR = DataGridViewCashBook.Rows(index).Cells(5).Value.ToString()
  6.  
  7. DataGridViewBankStatment.Rows.Add()
Last edited by farooq82; Feb 8th, 2009 at 5:07 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
farooq82 is offline Offline
29 posts
since Feb 2009
Feb 8th, 2009
0

Re: Dynamically adding row to datagrid

I think you should add the row\column to the DataTable(The Data Source of the Grid) then bind the Grid again.
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006
Feb 9th, 2009
0

Re: Dynamically adding row to datagrid

VB.NET Syntax (Toggle Plain Text)
  1. Dim newRow as DataRow = yourDatagrid.newrow()
  2.  
  3. newRow.Item(0) = "yourText"
  4. etc. etc. etc.
  5.  
  6. yourDatagrid.rows.add(newRow)
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: Hide Unuse Column in DataGrid
Next Thread in VB.NET Forum Timeline: Publishing worries





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


Follow us on Twitter


© 2011 DaniWeb® LLC