コード例 #1
0
        private void btnEditRadioGroup_Click(object sender, EventArgs e)
        {
            if (propertyGrid.SelectedObject != null &&
                propertyGrid.SelectedObject is UXRadioGroup)
            {
                UXRadioGroup uxRadioGroup = propertyGrid.SelectedObject as UXRadioGroup;

                using (KeyValueEditor keyValueEditor = new KeyValueEditor())
                {
                    keyValueEditor.CaptionDialog      = "Add Radiobuttons";
                    keyValueEditor.CaptionKeyColumn   = "Keyvalue";
                    keyValueEditor.CaptionValueColumn = "Caption";
                    keyValueEditor.MinimumKeysEntered = 1;
                    keyValueEditor.PopulateList(uxRadioGroup.Keys, uxRadioGroup.Values);
                    keyValueEditor.IsEditable = this.IsEditable;

                    if (keyValueEditor.ShowDialog() == DialogResult.OK)
                    {
                        // Get the new set of keys and values
                        uxRadioGroup.Keys   = keyValueEditor.KeyValues.Keys.ToList();
                        uxRadioGroup.Values = keyValueEditor.KeyValues.Values.ToList();
                    }
                }
            }
        }
コード例 #2
0
        private void okBtn_Click(object sender, EventArgs e)
        {
            if (UXComponent is UXRadioGroup)
            {
                UXRadioGroup radioGroup = UXComponent as UXRadioGroup;

                if (radioGroup.KeyValues.Count == 0)
                {
                    MessageBox.Show("You need to specify atleast one radio group option.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }

            if (componentMap != null && !(UXComponent is UXServiceComponent))
            {
                modelService.DeleteDomainObject(componentMap);
            }

            DialogResult = DialogResult.OK;
        }