public override ControlStyleBuilderInfoList GetThemeDesignedControls(System.Windows.Forms.Control previewSurface) { RadCheckBox button = new RadCheckBox(); button.AutoSize = true; button.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On; button.Text = "RadCheckBox"; button.Size = new Size(90, 20); RadCheckBox buttonStructure = new RadCheckBox(); button.AutoSize = true; buttonStructure.Text = "RadCheckBox"; ControlStyleBuilderInfo designed = new ControlStyleBuilderInfo(button, buttonStructure.RootElement); designed.MainElementClassName = typeof(RadCheckBoxElement).FullName; ControlStyleBuilderInfoList res = new ControlStyleBuilderInfoList(); res.Add(designed); return(res); }
private void CheckBoxEditor_ToggleStateChanged(object sender, StateChangedEventArgs args) { RadCheckBox radCheckBox = sender as RadCheckBox; if (radCheckBox == null) { return; } string localizedString1 = LocalizationProvider <RadGridLocalizationProvider> .CurrentProvider.GetLocalizedString("CustomFilterDialogTrue"); string localizedString2 = LocalizationProvider <RadGridLocalizationProvider> .CurrentProvider.GetLocalizedString("CustomFilterDialogFalse"); radCheckBox.Text = radCheckBox.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On ? localizedString1 : localizedString2; }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); if (this.DialogResult == DialogResult.OK) { Exception exception = this.UpdateValues(); RadGridLocalizationProvider currentProvider = LocalizationProvider <RadGridLocalizationProvider> .CurrentProvider; if (exception != null) { e.Cancel = true; string themeName = RadMessageBox.Instance.ThemeName; RadMessageBox.SetThemeName(this.ThemeName); int num = (int)RadMessageBox.Show(exception.Message, currentProvider.GetLocalizedString("CompositeFilterFormErrorCaption"), MessageBoxButtons.OK, RadMessageIcon.Error); RadMessageBox.SetThemeName(themeName); } if (!GridFilterCellElement.ValidateUserFilter(this.GetFilterDescriptor(this.compositeFilterDescriptor.Clone() as CompositeFilterDescriptor))) { e.Cancel = true; string themeName = RadMessageBox.Instance.ThemeName; RadMessageBox.SetThemeName(this.ThemeName); int num = (int)RadMessageBox.Show(currentProvider.GetLocalizedString("CompositeFilterFormInvalidFilter"), currentProvider.GetLocalizedString("CompositeFilterFormErrorCaption"), MessageBoxButtons.OK, RadMessageIcon.Error); RadMessageBox.SetThemeName(themeName); } } RadCheckBox rightEditor = this.rightEditor as RadCheckBox; RadCheckBox leftEditor = this.leftEditor as RadCheckBox; if (rightEditor != null) { rightEditor.ToggleStateChanged -= new StateChangedEventHandler(this.CheckBoxEditor_ToggleStateChanged); } if (leftEditor == null) { return; } leftEditor.ToggleStateChanged -= new StateChangedEventHandler(this.CheckBoxEditor_ToggleStateChanged); }
protected virtual Control CreateBoolean(PropertyDescriptor property) { Control control; if (this.DataEntryControl.Site == null) { RadCheckBox radCheckBox = new RadCheckBox(); EditorInitializingEventArgs e = new EditorInitializingEventArgs(property, (Control)radCheckBox, radCheckBox.GetType()); this.OnEditorInitializing((object)this, e); if (e.Cancel) { return((Control)null); } control = e.Editor; this.OnEditorInitialized((object)this, new EditorInitializedEventArgs(property, (Control)radCheckBox, radCheckBox.GetType())); } else { Control component = (Control)(this.designerHost.CreateComponent(typeof(RadCheckBox)) as RadCheckBox); EditorInitializingEventArgs e = new EditorInitializingEventArgs(property, component, component.GetType()); this.OnEditorInitializing((object)this, e); if (e.Cancel) { return((Control)null); } control = !object.ReferenceEquals((object)e.Editor, (object)component) ? this.designerHost.CreateComponent(e.EditorType) as Control : e.Editor; this.OnEditorInitialized((object)this, new EditorInitializedEventArgs(property, control, control.GetType())); } Binding binding = this.CreateBinding(control, "Checked", property.Name); if (binding != null) { control.DataBindings.Add(binding); } return(control); }
private void InitializeComponent() { this.radDropDownListLeftOperator = new RadDropDownList(); this.radDropDownListRightOperator = new RadDropDownList(); this.radLabelFormTitle = new RadLabel(); this.radioButtonAndOperator = new RadRadioButton(); this.radioButtonOrOperator = new RadRadioButton(); this.radButtonOK = new RadButton(); this.radButtonCancel = new RadButton(); this.groupBox = new RadGroupBox(); this.rchbNot = new RadCheckBox(); this.radDropDownListLeftOperator.BeginInit(); this.radLabelFormTitle.BeginInit(); this.radDropDownListRightOperator.BeginInit(); this.radioButtonAndOperator.BeginInit(); this.radioButtonOrOperator.BeginInit(); this.radButtonOK.BeginInit(); this.radButtonCancel.BeginInit(); this.groupBox.BeginInit(); this.rchbNot.BeginInit(); this.groupBox.SuspendLayout(); this.BeginInit(); this.SuspendLayout(); this.radDropDownListLeftOperator.DropDownSizingMode = SizingMode.UpDownAndRightBottom; this.radDropDownListLeftOperator.DropDownStyle = RadDropDownStyle.DropDownList; this.radDropDownListLeftOperator.Location = new Point(13, 32); this.radDropDownListLeftOperator.Name = "radComboBoxLeftOperator"; this.radDropDownListLeftOperator.Size = new Size(149, 21); this.radDropDownListLeftOperator.TabIndex = 0; this.radDropDownListLeftOperator.TabStop = false; this.radLabelFormTitle.Location = new Point(4, 12); this.radLabelFormTitle.Name = "radLabelFormTitle"; this.radLabelFormTitle.Size = new Size(96, 18); this.radLabelFormTitle.TabIndex = 2; this.radLabelFormTitle.Text = "Show rows where:"; this.radDropDownListRightOperator.DropDownSizingMode = SizingMode.UpDownAndRightBottom; this.radDropDownListRightOperator.DropDownStyle = RadDropDownStyle.DropDownList; this.radDropDownListRightOperator.Location = new Point(13, 79); this.radDropDownListRightOperator.Name = "radComboBoxRightOperator"; this.radDropDownListRightOperator.Size = new Size(149, 21); this.radDropDownListRightOperator.TabIndex = 4; this.radDropDownListRightOperator.TabStop = false; this.radioButtonAndOperator.AutoSize = true; this.radioButtonAndOperator.Location = new Point(43, 57); this.radioButtonAndOperator.Name = "radioButtonAndOperator"; this.radioButtonAndOperator.Size = new Size(46, 17); this.radioButtonAndOperator.TabIndex = 2; this.radioButtonAndOperator.TabStop = true; this.radioButtonAndOperator.Text = "And"; this.radioButtonOrOperator.AutoSize = true; this.radioButtonOrOperator.Location = new Point(93, 57); this.radioButtonOrOperator.Name = "radioButtonOrOperator"; this.radioButtonOrOperator.Size = new Size(38, 17); this.radioButtonOrOperator.TabIndex = 3; this.radioButtonOrOperator.TabStop = true; this.radioButtonOrOperator.Text = "Or"; this.radButtonOK.DialogResult = DialogResult.OK; this.radButtonOK.Location = new Point(196, 161); this.radButtonOK.Name = "radButtonOK"; this.radButtonOK.Size = new Size(75, 23); this.radButtonOK.TabIndex = 6; this.radButtonOK.Text = "OK"; this.radButtonOK.Click += new EventHandler(this.radButtonOK_Click); this.radButtonCancel.DialogResult = DialogResult.Cancel; this.radButtonCancel.Location = new Point(280, 161); this.radButtonCancel.Name = "radButtonCancel"; this.radButtonCancel.Size = new Size(75, 23); this.radButtonCancel.TabIndex = 7; this.radButtonCancel.Text = "Cancel"; this.radButtonCancel.Click += new EventHandler(this.radButtonCancel_Click); this.groupBox.BackColor = Color.Transparent; this.groupBox.Controls.Add((Control)this.radDropDownListLeftOperator); this.groupBox.Controls.Add((Control)this.rchbNot); this.groupBox.Controls.Add((Control)this.radDropDownListRightOperator); this.groupBox.Controls.Add((Control)this.radioButtonAndOperator); this.groupBox.Controls.Add((Control)this.radioButtonOrOperator); this.groupBox.FooterImageIndex = -1; this.groupBox.FooterImageKey = ""; this.groupBox.HeaderImageIndex = -1; this.groupBox.HeaderImageKey = ""; this.groupBox.HeaderMargin = new Padding(0); this.groupBox.Location = new Point(4, 36); this.groupBox.Name = "groupBox"; this.groupBox.RootElement.EnableElementShadow = false; this.groupBox.Size = new Size(361, 119); this.groupBox.TabIndex = 9; this.rchbNot.Location = new Point(14, 1); this.rchbNot.Name = "rchbNot"; this.rchbNot.Size = new Size(39, 18); this.rchbNot.TabIndex = 8; this.rchbNot.Text = "Not"; this.rchbNot.ToggleStateChanged += new StateChangedEventHandler(this.rchbNot_ToggleStateChanged); this.AcceptButton = (IButtonControl)this.radButtonOK; this.CancelButton = (IButtonControl)this.radButtonCancel; this.AutoScaleDimensions = new SizeF(6f, 13f); this.AutoScaleMode = AutoScaleMode.None; this.ClientSize = new Size(370, 196); this.Controls.Add((Control)this.groupBox); this.Controls.Add((Control)this.radButtonCancel); this.Controls.Add((Control)this.radButtonOK); this.Controls.Add((Control)this.radLabelFormTitle); this.FormBorderStyle = FormBorderStyle.FixedToolWindow; this.Name = nameof(CompositeFilterForm); this.MaximizeBox = false; this.RootElement.ApplyShapeToControl = true; this.StartPosition = FormStartPosition.CenterScreen; this.Text = "ComplexFilterForm"; this.radDropDownListLeftOperator.EndInit(); this.radDropDownListRightOperator.EndInit(); this.radioButtonAndOperator.EndInit(); this.radioButtonOrOperator.EndInit(); this.radLabelFormTitle.EndInit(); this.radButtonOK.EndInit(); this.radButtonCancel.EndInit(); this.groupBox.EndInit(); this.rchbNot.EndInit(); this.groupBox.ResumeLayout(false); this.groupBox.PerformLayout(); this.EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
// Methods public RadCheckBoxAccessibleObject(RadCheckBox owner) : base(owner) { owner.ToggleStateChanged += new StateChangedEventHandler(owner_ToggleStateChanged); }
public RadCheckBoxAccessibleObject(RadCheckBox owner, string name) : base((Control)owner, name) { this.owner = owner; this.owner.ToggleStateChanged += new StateChangedEventHandler(this.owner_ToggleStateChanged); }