Exemplo n.º 1
0
        private void simpleButtonNew_Click(object sender, EventArgs e)
        {
            Config.NewKeyValue("Operation", (sender as SimpleButton).Text);
            this.gcMain.Refresh();
            //this.gvMain.EndDataUpdate();
            string s = gvMain.ActiveFilterString;

            if (_data.DsData.Tables[0].PrimaryKey.Length > 0)
            {
                DataColumn colKey = _data.DsData.Tables[0].PrimaryKey[0];
                _data.DsData.Tables[0].PrimaryKey = null;
                colKey.AllowDBNull = true;
            }
            gvMain.ClearColumnsFilter();
            _frmDesigner.formAction = FormAction.New;
            _bindingSource.AddNew();
            _bindingSource.EndEdit();
            if (frmSingleDt == null)
            {
                frmSingleDt = new FrmSingleDt(_frmDesigner);
            }

            frmSingleDt.ShowDialog();
            gvMain.ActiveFilterString = s;
            gvMain.ApplyColumnsFilter();
            this.gvMain.BeginUpdate();
            this.gcMain.DataSource = null;
            this.gcMain.DataSource = _bindingSource.DataSource;
            this.gvMain.EndUpdate();
            this.gvMain.RefreshData();
            DisplayData();
            //this.bindingSource_CurrentChanged
            _data.DataChanged = false;
        }
Exemplo n.º 2
0
        private void simpleButtonNew_Click(object sender, EventArgs e)
        {
            Config.NewKeyValue("Operation", (sender as SimpleButton).Text);
            _frmDesigner.formAction = FormAction.New;

            if (frmSingleDt == null)
            {
                frmSingleDt = new FrmSingleDt(_frmDesigner);
            }
            _bindingSource.AddNew();

            _bindingSource.EndEdit();
            _frmDesigner.RefreshGridLookupEdit();
            frmSingleDt.ShowDialog();
            if (frmSingleDt.DialogResult == DialogResult.Cancel)
            {
                bsMain.DataSource = _data.DsData;
            }
        }