This is really bizarre and I could not figure it out.
Why is the Job_Status and Production_Status filled up in an alternate manner?
By default, when user creates a New Row Entry, Job_Status and Production_Status will have a default value set to them.
But here, I could not figure why only the alternate rows are filled.
As you can see, there are no problem with other fields, only DropDownList isn't filling the rows properly...
User creates New Entry by clicking AddNew Button.
Here I set default values to Job_StatusComboBox & Production_StatusComboBox
User then click SAVE to commit changesCode:Private Sub AddNew_btn_Click(sender As Object, e As EventArgs) Handles AddNew_btn.Click POTextBox.Focus() ProjectsBindingSource.AddNew() 'Set Default Text Job_StatusComboBox.Text = "On Hold" Production_StatusComboBox.Text = "Processing" Date_Of_EntryDateTimePicker.Value = DateTime.Now Lead_TimeDateTimePicker.Value = DateTime.Now Last_UpdatedLabel1.Text = Date.Now.ToString("dd-MM-yyyy HH:mm:ss") save_btn.BackColor = Color.DarkGray AddNew_btn.Enabled = False End Sub
Only SAVE, the DataGridView will update with the new row.Code:Private Sub save_btn_Click(sender As Object, e As EventArgs) Handles save_btn.Click AddNew_btn.Enabled = True Try Last_UpdatedLabel1.Text = Date.Now.ToString("dd-MM-yyyy HH:mm:ss") ProjectsBindingSource.EndEdit() ProjectsTableAdapter.Update(EVC_ProjectsDataSet.Projects) 'Name of DB Table 'Refresh the ID in the GridView EVC_ProjectsDataSet.Clear() ProjectsTableAdapter.Fill(EVC_ProjectsDataSet.Projects) MessageBox.Show("Data Saved!") save_btn.BackColor = DefaultBackColor Catch ex As Exception MessageBox.Show("Error saving data!") End Try loadCellColor() End Sub
So why are only alternate rows having the default value?




Reply With Quote
