private void sVCRESTR2BindingNavigatorSaveItem_Click(object sender, System.EventArgs e) { GridViewSvcRestr.ClearColumnsFilter(); if (SvcRestrBindingSource.Current == null) { return; } if (!checkRestrCode()) { MessageBox.Show("The restriction code for this property/service must be set to ‘A’ (agency) in order to save a record in the service restriction file."); return; } GridViewSvcRestr.CloseEditor(); ComboBoxEditType.Focus(); //bindingNavigatorPositionItem.Focus();//trigger field leave event bool temp = newRec; if (checkForms()) { ImageComboBoxEditCode.Focus(); panelControlStatus.Visible = true; LabelStatus.Text = "Record Saved"; rowStatusSave = new Timer(); rowStatusSave.Interval = 3000; rowStatusSave.Start(); rowStatusSave.Tick += TimedEventSave; setReadOnly(true); } if (!temp && !modified) { context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SVCRESTR)SvcRestrBindingSource.Current); } }
private void specialValueBindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (SpecialValueBindingSource.Current == null) { return; } GridViewSpecVal.CloseEditor(); ComboBoxEditType.Focus(); bool temp = newRec; //bindingNavigatorPositionItem.Focus(); if (checkForms()) { codeTextEdit.Focus(); setReadOnly(true); panelControlStatus.Visible = true; LabelStatus.Text = "Record Saved"; rowStatusSave = new Timer(); rowStatusSave.Interval = 3000; rowStatusSave.Start(); rowStatusSave.Tick += TimedEventSave; } if (!temp && !modified) { context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SpecialValue)SpecialValueBindingSource.Current); } }
private void sVCRESTR2BindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (SvcRestr2BindingSource.Current == null) { return; } GridViewSvcRest.CloseEditor(); ComboBoxEditType.Focus(); bool temp = newRec; //bindingNavigatorPositionItem.Focus();//trigger field leave event if (checkForms()) { //codeTextEdit.Focus(); //codeTextEdit.Properties.ReadOnly = true; //gridView1.Columns.ColumnByName(colName1).OptionsColumn.AllowEdit = false; panelControlStatus.Visible = true; LabelStatus.Text = "Record Saved"; rowStatusSave = new Timer(); rowStatusSave.Interval = 3000; rowStatusSave.Start(); rowStatusSave.Tick += TimedEventSave; } if (!temp && !modified) { context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SVCRESTR2)SvcRestr2BindingSource.Current); } }
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 CreateNewRecord() { _ignoreLeaveRow = true; //so that when the grid row changes it doesn't try to save again if (SaveRecord(true)) { //For some reason when there is no existing record in the binding source the Add method does not //trigger the CurrentChanged event, but AddNew does so use that instead BindingSource.AddNew(); //With the instant feedback data source, the new row is not immediately added to the grid, so move //the focused row to the filter row just so that no other existing row is visually highlighted GridViewLookup.FocusedRowHandle = DevExpress.Data.BaseListSourceDataController.FilterRow; SetReadOnlyKeyFields(false); ComboBoxEditType.Focus(); SetReadOnly(false); } ErrorProvider.Clear(); SetBuildMode(false); _ignoreLeaveRow = false; }
private bool move() { GridViewSpecVal.CloseEditor(); ComboBoxEditType.Focus(); //bindingNavigatorPositionItem.Focus();//trigger field leave event temp = newRec; if (checkForms()) { if (!temp) { context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SpecialValue)SpecialValueBindingSource.Current); } setReadOnly(true); newRec = false; modified = false; return(true); } return(false); }
private void bindingNavigatorAddNewItem_Click(object sender, System.EventArgs e) { GridViewSvcRestr.ClearColumnsFilter(); if (SvcRestrBindingSource.Current == null) { SvcRestrBindingSource.DataSource = from packrec in context.SVCRESTR where packrec.CODE == "KJM987" select packrec; SvcRestrBindingSource.AddNew(); if (GridViewSvcRestr.FocusedRowHandle == GridControl.AutoFilterRowHandle) { GridViewSvcRestr.FocusedRowHandle = GridViewSvcRestr.RowCount - 1; } ComboBoxEditType.Focus(); newRec = true; setReadOnly(false); setValues(); return; } ComboBoxEditType.Focus(); //bindingNavigatorPositionItem.Focus(); //trigger field leave event GridViewSvcRestr.CloseEditor(); temp = newRec; if (checkForms()) { errorProvider1.Clear(); if (!temp) { context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SVCRESTR)SvcRestrBindingSource.Current); } SvcRestrBindingSource.AddNew(); if (GridViewSvcRestr.FocusedRowHandle == GridControl.AutoFilterRowHandle) { GridViewSvcRestr.FocusedRowHandle = GridViewSvcRestr.RowCount - 1; } ComboBoxEditType.Focus(); newRec = true; setValues(); setReadOnly(false); } }
private bool move() { GridViewSvcRest.CloseEditor(); ComboBoxEditType.Focus(); //bindingNavigatorPositionItem.Focus();//trigger field leave event temp = newRec; if (checkForms()) { if (!temp) { context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SVCRESTR2)SvcRestr2BindingSource.Current); } //codeTextEdit.Properties.ReadOnly = true; //gridView1.Columns.ColumnByName(colName1).OptionsColumn.AllowEdit = false; newRec = false; modified = false; return(true); } return(false); }
private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { GridViewSpecVal.ClearColumnsFilter(); if (SpecialValueBindingSource.Current == null) { //fake query in order to create a link between the database table and the binding source SpecialValueBindingSource.DataSource = from opt in context.SpecialValue where opt.Code == "KJM9" select opt; SpecialValueBindingSource.AddNew(); if (GridViewSpecVal.FocusedRowHandle == GridControl.AutoFilterRowHandle) { GridViewSpecVal.FocusedRowHandle = GridViewSpecVal.RowCount - 1; } ComboBoxEditType.Focus(); setReadOnly(false); newRec = true; return; } ComboBoxEditType.Focus(); //bindingNavigatorPositionItem.Focus(); //trigger field leave event GridViewSpecVal.CloseEditor(); temp = newRec; if (checkForms()) { if (!temp) { context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SpecialValue)SpecialValueBindingSource.Current); } SpecialValueBindingSource.AddNew(); if (GridViewSpecVal.FocusedRowHandle == GridControl.AutoFilterRowHandle) { GridViewSpecVal.FocusedRowHandle = GridViewSpecVal.RowCount - 1; } ComboBoxEditType.Focus(); setReadOnly(false); newRec = true; } }