public override void BeginEdit()
        {
            base.BeginEdit();
            RadTextBoxEditorElement editorElement = (RadTextBoxEditorElement)this.EditorElement;
            RadTextBoxItem          textBoxItem   = editorElement.TextBoxItem;

            if (!VirtualGridTextBoxEditor.IsDarkTheme(this.OwnerElement))
            {
                int num = (int)editorElement.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.KeyUp        += new KeyEventHandler(this.TextBoxItem_KeyUp);
            textBoxItem.MouseWheel   += new MouseEventHandler(this.TextBoxItem_MouseWheel);
        }
Beispiel #2
0
        public override void BeginEdit()
        {
            base.BeginEdit();
            RadMaskedEditBoxEditorElement editorElement = this.EditorElement as RadMaskedEditBoxEditorElement;
            string str = (this.MaskTextBox.Value != null ? this.MaskTextBox.Value.ToString() : this.MaskTextBox.Text).Replace(" ", "");

            this.oldValue = str;
            if (!VirtualGridTextBoxEditor.IsDarkTheme(this.OwnerElement))
            {
                editorElement.BackColor = Color.White;
            }
            editorElement.TextBoxItem.SelectAll();
            editorElement.TextChanging  += new TextChangingEventHandler(this.Editor_TextChanging);
            editorElement.ValueChanged  += new EventHandler(this.Editor_TextChanged);
            this.MaskTextBox.KeyDown    += new KeyEventHandler(this.MaskTextBox_KeyDown);
            this.MaskTextBox.KeyUp      += new KeyEventHandler(this.MaskTextBox_KeyUp);
            this.MaskTextBox.MouseWheel += new MouseEventHandler(this.Editor_MouseWheel);
            this.MaskTextBox.TextBoxItem.HostedControl.Focus();
            this.originalValue   = (object)str;
            this.selectionStart  = -1;
            this.selectionLength = -1;
        }