private void bindingNavigatorMoveLastItem_Click(object sender, EventArgs e) { if (move()) { SvcRestr2BindingSource.MoveLast(); } }
private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { if (SvcRestr2BindingSource.Current == null) { SvcRestr2BindingSource.AddNew(); //codeTextEdit.Focus(); //codeTextEdit.Properties.ReadOnly = false; //gridView1.Columns.ColumnByName(colName1).OptionsColumn.AllowEdit = true; newRec = true; return; } ComboBoxEditType.Focus(); //bindingNavigatorPositionItem.Focus(); //trigger field leave event GridViewSvcRest.CloseEditor(); temp = newRec; if (checkForms()) { if (!temp) { context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SVCRESTR2)SvcRestr2BindingSource.Current); } SvcRestr2BindingSource.AddNew(); //codeTextEdit.Focus(); //codeTextEdit.Properties.ReadOnly = false; //gridView1.Columns.ColumnByName(colName1).OptionsColumn.AllowEdit = true; newRec = true; } }
private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) { if (SvcRestr2BindingSource.Current == null) { return; } GridViewSvcRest.CloseEditor(); if (MessageBox.Show("Are you sure you want to delete?", "CONFIRM", MessageBoxButtons.YesNo) == DialogResult.Yes) { modified = false; newRec = false; SvcRestr2BindingSource.RemoveCurrent(); errorProvider1.Clear(); context.SaveChanges(); panelControlStatus.Visible = true; LabelStatus.Text = "Record Deleted"; rowStatusDelete = new Timer(); rowStatusDelete.Interval = 3000; rowStatusDelete.Start(); rowStatusDelete.Tick += new EventHandler(TimedEventDelete); } //currentVal = codeTextEdit.Text; }