943,575 Members | Top Members by Rank

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

add datagridview

Expand Post »
this is a error when i click the button add

Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound.

VB.NET Syntax (Toggle Plain Text)
  1. DataGridView1.Rows.Add((txtPelan.Text), (txt36P.Text))
\
anyone can help me?
Reputation Points: 10
Solved Threads: 1
Light Poster
ggl0rd is offline Offline
40 posts
since Jul 2009
Aug 29th, 2009
1

Re: add datagridview

you have to add it first to your dataset. and then you can add this row.

here is some sample code that you need to adjust a bit but it gives you the idea
vb Syntax (Toggle Plain Text)
  1. Dim rwNewData As DATASETRujukanRekod.RekodAnggaranRow
  2. Dim daNewdata As New DATASETRujukanRekodTableAdapters.RekodAnggaranTableAdapter
  3. rwNewData = DATASETRujukanRekod.Tables("whatTable").NewRow
  4. rwNewData.ItemArray = New Object() {"38", "bla"}
  5. DATASETRujukanRekod.Tables("whatTable").Rows.Add(rwNewData)
  6. RekodAnggaranTableAdapter.Fill(DATASETRujukanRekod.RekodAnggaran)
Featured Poster
Reputation Points: 208
Solved Threads: 168
Practically a Master Poster
GeekByChoiCe is offline Offline
692 posts
since Jun 2009

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: using stopwatch to pause an application
Next Thread in VB.NET Forum Timeline: deploying an application with crystal reports





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


Follow us on Twitter


© 2011 DaniWeb® LLC