コード例 #1
0
        private void EditForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            XtraForm form = sender as XtraForm;

            foreach (Control control in form.Controls)
            {
                if (control is EditFormContainer)
                {
                    UCCRUDBase uc = (control as EditFormContainer).ActiveControl as UCCRUDBase;

                    if (uc != null)
                    {
                        uc.GridView.CancelUpdateCurrentRow();
                    }
                }
            }
        }
コード例 #2
0
        public void gvMain_ShowingPopupEditForm(object sender, DevExpress.XtraGrid.Views.Grid.ShowingPopupEditFormEventArgs e)
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmThongTinHocSinh));

            e.EditForm.MaximizeBox = false;
            e.EditForm.MinimizeBox = false;

            foreach (Control control in e.EditForm.Controls)
            {
                if (control is EditFormContainer)
                {
                    foreach (Control nestedControl in control.Controls)
                    {
                        if (nestedControl is PanelControl)
                        {
                            foreach (Control button in nestedControl.Controls)
                            {
                                if (button is SimpleButton)
                                {
                                    SimpleButton simpleButton = button as SimpleButton;

                                    if (!EDIT_FORM_BUTTON_CAPTION_TO_IMAGE_MAP.ContainsKey(simpleButton.Text))
                                    {
                                        return;
                                    }

                                    simpleButton.Image = ((System.Drawing.Image)(resources.GetObject(EDIT_FORM_BUTTON_CAPTION_TO_IMAGE_MAP[simpleButton.Text])));
                                    simpleButton.Text  = EDIT_FORM_BUTTON_CAPTION_MAP[simpleButton.Text];

                                    ActivityTrackerFacade.InitActivityTracker(e.EditForm);
                                }
                            }
                        }
                    }
                }
            }

            // Perform cancelling on EditForm closed
            GridView   gridView = sender as GridView;
            UCCRUDBase uc       = gridView.OptionsEditForm.CustomEditFormLayout as UCCRUDBase;

            uc.GridView            = gridView;
            e.EditForm.FormClosed += new FormClosedEventHandler(EditForm_FormClosed);
        }