示例#1
0
        protected virtual void OnKeyUp(KeyEventArgs e)
        {
            RadSpinEditorElement editorElement = this.EditorElement as RadSpinEditorElement;

            if (editorElement == null || !editorElement.IsInValidState(true))
            {
                return;
            }
            switch (e.KeyCode)
            {
            case Keys.Left:
                if ((!this.RightToLeft || this.selectionStart != editorElement.Text.Length) && (this.RightToLeft || this.selectionStart != 0 || this.selectionLength != 0))
                {
                    break;
                }
                editorElement.Validate();
                base.OnKeyDown(e);
                break;

            case Keys.Right:
                if ((!this.RightToLeft || this.selectionStart != 0) && (this.RightToLeft || this.selectionStart != editorElement.Text.Length))
                {
                    break;
                }
                editorElement.Validate();
                base.OnKeyDown(e);
                break;
            }
        }
示例#2
0
        public override void OnKeyDown(KeyEventArgs e)
        {
            RadSpinEditorElement editorElement = this.EditorElement as RadSpinEditorElement;

            if (editorElement == null || !editorElement.IsInValidState(true))
            {
                return;
            }
            this.selectionStart  = editorElement.TextBoxItem.SelectionStart;
            this.selectionLength = editorElement.TextBoxItem.SelectionLength;
            switch (e.KeyCode)
            {
            case Keys.Return:
                if (e.Modifiers == Keys.Control)
                {
                    break;
                }
                editorElement.Validate();
                base.OnKeyDown(e);
                break;

            case Keys.Delete:
                if (this.selectionLength != editorElement.TextBoxItem.TextLength)
                {
                    break;
                }
                editorElement.Text = (string)null;
                break;
            }
        }
 public override AccessibleObject GetChild(int index)
 {
     if (this.owner.IsInEditMode && this.owner.CurrentRow == this.row && this.owner.CurrentColumn == this.column)
     {
         BaseGridEditor activeEditor = this.owner.ActiveEditor as BaseGridEditor;
         if (activeEditor != null)
         {
             RadElement           editorElement = activeEditor.EditorElement;
             RadSpinEditorElement editor        = editorElement as RadSpinEditorElement;
             if (editor != null)
             {
                 return((AccessibleObject) new RadGridSpinEditorElementAccessibleObject(this.owner, editor, this, editor.ControlBoundingRectangle.Size, new Point(editor.ControlBoundingRectangle.X, editor.ControlBoundingRectangle.Y), editor.Name));
             }
             RadDropDownListEditorElement listEditorElement = editorElement as RadDropDownListEditorElement;
             if (listEditorElement != null)
             {
                 if (this.dropDownListAccessibleObject != null)
                 {
                     this.dropDownListAccessibleObject.UnwireEvents();
                 }
                 this.dropDownListAccessibleObject = new GridDropDownAccessibilityObject((RadDropDownListElement)listEditorElement, this, listEditorElement.Name);
                 return((AccessibleObject)this.dropDownListAccessibleObject);
             }
         }
     }
     return(base.GetChild(index));
 }
示例#4
0
        public override bool EndEdit()
        {
            base.EndEdit();
            RadSpinEditorElement editorElement = this.EditorElement as RadSpinEditorElement;

            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.EnableValueChangingOnTextChanging = false;
            editorElement.Value = editorElement.MinValue;
            return(true);
        }
示例#5
0
        public override void BeginEdit()
        {
            base.BeginEdit();
            RadSpinEditorElement editorElement = this.EditorElement as RadSpinEditorElement;

            editorElement.SetTextValueChanged(true);
            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);
            if (!RadTextBoxEditor.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.EnableValueChangingOnTextChanging = this.OwnerElement is GridFilterCellElement;
        }