public override void BeginEdit()
        {
            base.BeginEdit();
            RadTextBoxItem textBoxItem = this.TextBoxEditorElement.TextBoxItem;

            if (!BaseTextBoxEditor.IsDarkTheme(this.OwnerElement))
            {
                int num = (int)this.TextBoxEditorElement.SetDefaultValueOverride(VisualElement.BackColorProperty, (object)Color.White);
            }
            RadControl radControl = this.EditorElement.ElementTree == null || this.EditorElement.ElementTree.Control == null ? (RadControl)null : this.EditorElement.ElementTree.Control as RadControl;

            if (radControl != null && TelerikHelper.IsMaterialTheme(radControl.ThemeName))
            {
                textBoxItem.StretchVertically = true;
                if (this.EditorElement.Parent != null)
                {
                    this.EditorElement.Parent.UpdateLayout();
                }
            }
            else
            {
                textBoxItem.StretchVertically = textBoxItem.Multiline;
            }
            textBoxItem.SelectAll();
            textBoxItem.TextBoxControl.Focus();
            textBoxItem.TextChanging            += new TextChangingEventHandler(this.TextBoxItem_TextChanging);
            textBoxItem.TextChanged             += new EventHandler(this.TextBoxItem_TextChanged);
            textBoxItem.KeyDown                 += new KeyEventHandler(this.TextBoxItem_KeyDown);
            textBoxItem.HostedControl.LostFocus += new EventHandler(this.HostedControl_LostFocus);
        }
Beispiel #2
0
        public override void BeginEdit()
        {
            base.BeginEdit();
            BaseSpinEditorElement editorElement = this.EditorElement as BaseSpinEditorElement;

            editorElement.ValueChanging      += new ValueChangingEventHandler(this.spinElement_ValueChanging);
            editorElement.ValueChanged       += new EventHandler(this.spinElement_ValueChanged);
            editorElement.KeyDown            += new KeyEventHandler(this.spinElement_KeyDown);
            editorElement.KeyUp              += new KeyEventHandler(this.spinElement_KeyUp);
            editorElement.RadPropertyChanged += new RadPropertyChangedEventHandler(this.spinElement_RadPropertyChanged);
            if (!BaseTextBoxEditor.IsDarkTheme(this.OwnerElement))
            {
                int num = (int)editorElement.SetDefaultValueOverride(VisualElement.BackColorProperty, (object)Color.White);
            }
            editorElement.TextBoxItem.SelectAll();
            editorElement.TextBoxItem.TextBoxControl.Focus();
            editorElement.RightToLeft = this.RightToLeft;
            editorElement.TextBoxItem.HostedControl.LostFocus += new EventHandler(this.HostedControl_LostFocus);
        }
Beispiel #3
0
        public override void BeginEdit()
        {
            base.BeginEdit();
            RadDateTimePickerElement  editorElement   = (RadDateTimePickerElement)this.EditorElement;
            RadTextBoxElement         textBoxElement1 = (RadTextBoxElement)editorElement.TextBoxElement;
            RadDateTimePickerCalendar currentBehavior = editorElement.CurrentBehavior as RadDateTimePickerCalendar;

            editorElement.TextBoxElement.TextBoxItem.HostedControl.Focus();
            editorElement.TextBoxElement.TextBoxItem.SelectionStart  = 0;
            editorElement.TextBoxElement.TextBoxItem.SelectionLength = 1;
            if (currentBehavior != null)
            {
                currentBehavior.DropDownMinSize = new Size(editorElement.Size.Width, 200);
                RadMaskedEditBoxElement textBoxElement2 = editorElement.TextBoxElement;
                MaskDateTimeProvider    provider        = (MaskDateTimeProvider)textBoxElement2.Provider;
                provider.SelectFirstEditableItem();
                this.selectedItemIndex = provider.SelectedItemIndex;
                currentBehavior.PopupControl.Opened += new EventHandler(this.PopupControl_Opened);
                currentBehavior.PopupControl.Closed += new RadPopupClosedEventHandler(this.PopupControl_Closed);
                currentBehavior.Calendar.CalendarElement.CalendarStatusElement.ClearButton.Click += new EventHandler(this.ClearButton_Click);
                currentBehavior.Calendar.CalendarElement.CalendarStatusElement.TodayButton.Click += new EventHandler(this.TodayButton_Click);
                DateTime?nullable = editorElement.Value;
                DateTime nullDate = editorElement.NullDate;
                if ((!nullable.HasValue ? 0 : (nullable.GetValueOrDefault() == nullDate ? 1 : 0)) != 0)
                {
                    textBoxElement2.Text = string.Empty;
                }
            }
            editorElement.NotifyParentOnMouseInput = false;
            if (!BaseTextBoxEditor.IsDarkTheme(this.OwnerElement))
            {
                int num = (int)editorElement.SetDefaultValueOverride(VisualElement.BackColorProperty, (object)Color.White);
            }
            editorElement.ValueChanging += new ValueChangingEventHandler(this.RadDateTimeEditor_ValueChanging);
            editorElement.ValueChanged  += new EventHandler(this.RadDateTimeEditor_ValueChanged);
            if (textBoxElement1 == null)
            {
                return;
            }
            textBoxElement1.KeyDown += new KeyEventHandler(this.TextBoxElement_KeyDown);
            textBoxElement1.TextBoxItem.HostedControl.LostFocus += new EventHandler(this.HostedControl_LostFocus);
        }