Datagridview keeps adding unwanted new column


Nov 29, 2009
Programming Experience
Hi all.... if anyone can help me with this i would be very greatfull! Im using VB08 Express Edition

I have simply made a new project (windows form application). Put 2 dataviewgrids on the form. Added 3 columns to each grid (at design time).

I then added one line of code as follows to the rows added event.

Private Sub DataGridView1_RowsAdded(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowsAddedEventArgs) Handles DataGridView1.RowsAdded

DataGridView2.RowCount = DataGridView1.RowCount

End Sub

This works ie when you add a row to datagridview1, it also adds one to datagridview2 - BUT when the project first loads, it adds an extra column before my columns....

Why is this? is it a bug in vb.

Thanks for any help given, sijcooke!
Top Bottom