コード例 #1
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            if (gridMain.SelectedIndices.Length != 1)
            {
                MsgBox.Show(this, "Please select one required field first.");
                return;
            }
            int mainSelected           = gridMain.SelectedIndices[0];
            FormReqFieldCondEdit FormR = new FormReqFieldCondEdit(_reqFieldCur);

            FormR.IsNew = true;
            FormR.ShowDialog();
            if (FormR.DialogResult == DialogResult.OK)
            {
                int countConditionsBefore = _reqFieldCur.ListRequiredFieldConditions.Count;
                _reqFieldCur.RefreshConditions();
                FillConditions();
                if (countConditionsBefore == 0)
                {
                    //So that an 'X' will appear in the 'Conditions' column
                    FillMain();
                    gridMain.SetSelected(mainSelected, true);
                }
            }
        }
コード例 #2
0
        private void gridConditions_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            FormReqFieldCondEdit FormR = new FormReqFieldCondEdit(_reqFieldCur, (RequiredFieldName)gridConditions.ListGridRows[e.Row].Tag);

            FormR.IsNew = false;
            FormR.ShowDialog();
            if (FormR.DialogResult == DialogResult.OK)
            {
                _reqFieldCur.RefreshConditions();
                int mainSelectedIndex = gridMain.SelectedIndices[0];
                FillMain();
                FillConditions();
                gridMain.SetSelected(mainSelectedIndex, true);
            }
        }