Exemplo n.º 1
0
        private void SetEditorValue(object value)
        {
            RadBrowseEditorElement editorElement = this.EditorElement as RadBrowseEditorElement;

            editorElement.Value = value == null || string.IsNullOrEmpty(value.ToString()) ? string.Empty : value.ToString();
            this.originalValue  = (object)editorElement.Value;
        }
Exemplo n.º 2
0
        protected override void OnKeyUp(KeyEventArgs e)
        {
            RadBrowseEditorElement editorElement = this.EditorElement as RadBrowseEditorElement;

            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;
                }
                this.ProcessKeyDown(e);
                break;

            case Keys.Right:
                if (this.selectionLength != 0 || (this.RightToLeft || this.selectionStart != length) && (!this.RightToLeft || this.selectionStart != 0))
                {
                    break;
                }
                this.ProcessKeyDown(e);
                break;
            }
        }
        protected override void OnKeyDown(KeyEventArgs e)
        {
            RadBrowseEditorElement  editorElement = this.EditorElement as RadBrowseEditorElement;
            PropertyGridItemElement ownerElement  = this.OwnerElement as PropertyGridItemElement;

            if (ownerElement == null)
            {
                return;
            }
            switch (e.KeyCode)
            {
            case Keys.Return:
                if (!this.Validate())
                {
                    break;
                }
                ownerElement.PropertyTableElement.EndEdit();
                break;

            case Keys.Escape:
                ownerElement.Data.PropertyGridTableElement.CancelEdit();
                break;

            case Keys.Delete:
                if (editorElement.TextBoxItem.SelectionLength != editorElement.TextBoxItem.TextLength)
                {
                    break;
                }
                editorElement.Text = string.Empty;
                break;
            }
        }
Exemplo n.º 4
0
        protected virtual RadBrowseEditorElement CreateEditorElement()
        {
            RadBrowseEditorElement browseEditorElement = new RadBrowseEditorElement();
            int num = (int)browseEditorElement.SetDefaultValueOverride(RadElement.StretchVerticallyProperty, (object)true);

            return(browseEditorElement);
        }
Exemplo n.º 5
0
 protected override void CreateChildItems(RadElement parent)
 {
     base.CreateChildItems(parent);
     this.browseElement = this.CreateEditorElement();
     parent.Children.Add((RadElement)this.browseElement);
     this.WireEvents();
 }
Exemplo n.º 6
0
        public override void BeginEdit()
        {
            base.BeginEdit();
            RadBrowseEditorElement editorElement = this.EditorElement as RadBrowseEditorElement;

            editorElement.ValueChanging += new ValueChangingEventHandler(this.editorElement_ValueChanging);
            editorElement.ValueChanged  += new EventHandler(this.editorElement_ValueChanged);
            editorElement.DialogClosed  += new DialogClosedEventHandler(this.editorElement_DialogClosed);
            editorElement.KeyUp         += new KeyEventHandler(this.editorElement_KeyUp);
            editorElement.KeyDown       += new KeyEventHandler(this.editorElement_KeyDown);
        }
Exemplo n.º 7
0
        public override bool EndEdit()
        {
            base.EndEdit();
            RadBrowseEditorElement editorElement = this.EditorElement as RadBrowseEditorElement;

            editorElement.ValueChanging -= new ValueChangingEventHandler(this.editorElement_ValueChanging);
            editorElement.ValueChanged  -= new EventHandler(this.editorElement_ValueChanged);
            editorElement.KeyDown       -= new KeyEventHandler(this.editorElement_KeyDown);
            editorElement.KeyUp         -= new KeyEventHandler(this.editorElement_KeyUp);
            editorElement.TextBoxItem.HostedControl.LostFocus -= new EventHandler(this.HostedControl_LostFocus);
            return(true);
        }
Exemplo n.º 8
0
        public override bool EndEdit()
        {
            base.EndEdit();
            RadBrowseEditorElement editorElement = this.EditorElement as RadBrowseEditorElement;

            editorElement.ValueChanging -= new ValueChangingEventHandler(this.editorElement_ValueChanging);
            editorElement.ValueChanged  -= new EventHandler(this.editorElement_ValueChanged);
            editorElement.DialogClosed  -= new DialogClosedEventHandler(this.editorElement_DialogClosed);
            editorElement.KeyUp         -= new KeyEventHandler(this.editorElement_KeyUp);
            editorElement.KeyDown       -= new KeyEventHandler(this.editorElement_KeyDown);
            return(true);
        }
Exemplo n.º 9
0
        public override void BeginEdit()
        {
            base.BeginEdit();
            RadBrowseEditorElement editorElement = this.EditorElement as RadBrowseEditorElement;

            editorElement.ValueChanging += new ValueChangingEventHandler(this.editorElement_ValueChanging);
            editorElement.ValueChanged  += new EventHandler(this.editorElement_ValueChanged);
            editorElement.KeyDown       += new KeyEventHandler(this.editorElement_KeyDown);
            editorElement.KeyUp         += new KeyEventHandler(this.editorElement_KeyUp);
            editorElement.TextBoxItem.SelectAll();
            editorElement.TextBoxItem.TextBoxControl.Focus();
            editorElement.RightToLeft = this.RightToLeft;
            editorElement.TextBoxItem.HostedControl.LostFocus += new EventHandler(this.HostedControl_LostFocus);
        }
Exemplo n.º 10
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            RadBrowseEditorElement editorElement = this.EditorElement as RadBrowseEditorElement;

            if (editorElement == null || !editorElement.IsInValidState(true))
            {
                return;
            }
            this.selectionStart  = editorElement.TextBoxItem.SelectionStart;
            this.selectionLength = editorElement.TextBoxItem.SelectionLength;
            if (e.KeyCode == Keys.Return && e.Modifiers != Keys.Control)
            {
                this.ProcessKeyDown(e);
            }
            else
            {
                if (e.KeyCode != Keys.Escape)
                {
                    return;
                }
                this.ProcessKeyDown(e);
                e.Handled = true;
            }
        }