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