Пример #1
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            RadTimePickerElement editorElement = this.EditorElement as RadTimePickerElement;

            if (editorElement == null || !editorElement.IsInValidState(true))
            {
                return;
            }
            BaseListViewVisualItem ownerElement = this.OwnerElement as BaseListViewVisualItem;

            if (ownerElement == null)
            {
                return;
            }
            if (e.KeyCode == Keys.Return)
            {
                ownerElement.Data.Owner.EndEdit();
            }
            else if (e.KeyCode == Keys.Escape)
            {
                ownerElement.Data.Owner.CancelEdit();
            }
            else
            {
                base.OnKeyDown(e);
            }
        }
Пример #2
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            RadTimePickerElement editorElement = this.EditorElement as RadTimePickerElement;

            if (editorElement == null || !editorElement.IsInValidState(true))
            {
                return;
            }
            PropertyGridItemElement ownerElement = this.OwnerElement as PropertyGridItemElement;

            if (ownerElement == null)
            {
                return;
            }
            if (e.KeyCode == Keys.Return)
            {
                ownerElement.PropertyTableElement.EndEdit();
            }
            else if (e.KeyCode == Keys.Escape)
            {
                ownerElement.PropertyTableElement.CancelEdit();
            }
            else
            {
                base.OnKeyDown(e);
            }
        }