two rows added

SDR

Member
Joined
Oct 3, 2008
Messages
9
Programming Experience
Beginner
When I add a new row to my datagrid it creates 2 rows instead of 1. I am using the Add New Item function on the Navigator bar that looks like a plus symbol (+) to add a row and populate it. It populates the new row but then adds another blank row and places the focus on it. If I don't populate the first row like in my code below then it just creates 2 blank rows. How do I get it to not create the extra row?

Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click
Me.Time_RecordBindingSource.AddNew()
Me.Employee_account_nameTextBox.Text = Me.cmbEmp.SelectedValue.ToString()
Me.Start_date_timeDateTimePicker.Value = Me.dtpStartDate.Value
Me.End_date_timeDateTimePicker.Value = Me.dtpEndDate.Value
Me.btnUpdate.Enabled = True
End Sub
 
Back
Top