Thank you for your response jmcilhinney, and I apologise for posting in the wrong section, but I really didn't think it would go in Windows forms as it is a web application. I have been thrown in at the deep end a little here in that I'm not technically a programmer but doing my best to do a job as one, I'm learning a lot of new technology as I go along, and it can be quite daunting to post a question here, and to try and include as much detail as possible, never mind try to choose the correct form to post on.
In relation to your answer, I am not doing the exact same thing as the way you have in the code you provided. I will try and give you as much info. as possible, but it seems to be done differently, this is a project I have taken from someone else to complete, the come from a C++ background and this is in
VB.Net. I have made some modifications to include more tables than original.
It is a series of tabs, so when each tab is clicked the datagrid is populated by a different table adapter, the code from the Select Case TabControl1.SelectedIndex is below:
Code:
Case 1
BindingSource1.DataMember = "tPriority"
TPriorityTableAdapter1.Fill(MaintDataSet1.tPriority)
And it is something similar for each of the tabs.
Now when I say it writes the row to the database after I tab to the next field that's what it does seem to do. This is how I came to that conclusion: The asterisk symbol * is beside the start of a new row, so I type in the first column and then press tab, straight away, a new line below appears, but the 2nd column in the row I was adding (above the new line) is still highlighted.
I try to continue with the new row I was adding (which is now the 2nd last line). I type a code into the 2nd column, and then press tab to move to the 3rd column. At this stage it highlights the 3rd column, but then pops up another webpage with the error message: "Column 'RefCode' does not allow nulls" - this is because of the SQL constraints I mentioned previously.
Maybe I am mistaken, and the line hasn't been written to the database yet, but it seems to attempt to write it because it gives out about the column not allowing nulls.
Either way, I need to find where in the code it is doing this?
One thing I have just noticed is that it (the datagridview) is a Gizmox.WebGui.Forms.DataGridView control, where as yours is a System.Windows.Forms.DataGridView control. This is probably where the problem is with some auto generated code???
Thanks again for response so far, and I apologise again for disturbance caused by posting in the wrong thread, it was not intentional or laziness.