private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) { if (CompanyBindingSource.Current == null) { return; } GridViewCompany.CloseEditor(); if (MessageBox.Show("Are you sure you want to delete?", "CONFIRM", MessageBoxButtons.YesNo) == DialogResult.Yes) { modified = false; newRec = false; CompanyBindingSource.RemoveCurrent(); errorProvider1.Clear(); context.SaveChanges(); cODETextEdit.Properties.ReadOnly = true; GridViewCompany.Columns.ColumnByName(colName).OptionsColumn.AllowEdit = false; panelControlStatus.Visible = true; LabelStatus.Text = "Record Deleted"; rowStatusDelete = new Timer(); rowStatusDelete.Interval = 3000; rowStatusDelete.Start(); rowStatusDelete.Tick += new EventHandler(TimedEventDelete); } currentVal = cODETextEdit.Text; }