private void btnNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { gvAction.CloseEditor(); using (FrmAGVCommod frm = new FrmAGVCommod(0, bsActions.Count + 1)) { if (frm.ShowDialog() == DialogResult.OK) { if (frm.mid_obj != null) { this.bsActions.Add(frm.mid_obj as CmdInfo); bsActions.MoveLast(); bsActions.ResetBindings(false); } } } } catch (Exception ex) { MsgBox.ShowError(ex.Message); } }
private void gvAction_DoubleClick(object sender, EventArgs e) { try { CmdInfo currAction = bsActions.Current as CmdInfo; if (currAction == null) { return; } using (FrmAGVCommod frmSet = new FrmAGVCommod(1, currAction.CmdCode)) { frmSet.agvNewAction = currAction; if (frmSet.ShowDialog() == DialogResult.OK) { currAction = frmSet.mid_obj as CmdInfo; bsActions.ResetBindings(false); } } } catch (Exception ex) { MsgBox.ShowError(ex.Message); } }