protected virtual void OnKeyUp(KeyEventArgs e) { RadTextBoxEditorElement editorElement = this.EditorElement as RadTextBoxEditorElement; if (editorElement == null || !editorElement.IsInValidState(true)) { return; } int length = editorElement.Text.Length; switch (e.KeyCode) { case Keys.Left: if (this.selectionLength != 0 || (this.RightToLeft || this.selectionStart != 0) && (!this.RightToLeft || this.selectionStart != length)) { break; } base.OnKeyDown(e); break; case Keys.Right: if (this.selectionLength != 0 || (this.RightToLeft || this.selectionStart != length) && (!this.RightToLeft || this.selectionStart != 0)) { break; } base.OnKeyDown(e); break; } }
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); }