Hi all.
My problem is probably ignorance as to how the DGV works, anyway, the problem.
I have a bound datagridview which is used to collect user input. Data for 3 of the 7 fields is entered by looping through the rows and progmatically entering common data anfter a 'Save' Button is pressed:
For I = 0 To DG1.RowCount - 2
DG1.Rows(I).Cells(4).Value = TextBox1.Text 'Operator
DG1.Rows(I).Cells(5).Value = TextBox2.Text 'Date
DG1.Rows(I).Cells(6).Value = TextBox3.Text 'Time
Next
DG1.Update
Prior to this loop I delete the last unused row if its not a new row:
DG1.CurrentCell = DG1.Item(0, DG1.RowCount - 2)
If DG1.CurrentCell.Value.ToString = "" Then
DG1.Rows.RemoveAt(DG1.RowCount - 2)
DG1.Update()
End If
At this point the DGV looks the way it should...All fields completed correctly and no un used ro except for the new row.
After saving :
Me.ItemTableTableAdapter.Update(Me.StockMoveDataSet.ItemTable)
The 'Operator', 'Date', and 'Time' are not saved to the database for the first row only
Can someone please help me.
Thanks
(Rate)