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); } }
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); } }
public override bool EndEdit() { RadTimePickerElement editorElement = this.EditorElement as RadTimePickerElement; editorElement.MaskedEditBox.TextBoxItem.KeyDown -= new KeyEventHandler(this.OnTextBoxItemKeyDown); editorElement.MaskedEditBox.TextBoxItem.KeyUp -= new KeyEventHandler(this.OnTextBoxItemKeyUp); editorElement.ValueChanged -= new EventHandler(this.OnEditorElementValueChanged); editorElement.ValueChanging -= new CancelEventHandler(this.OnEditorElementValueChanging); editorElement.PopupClosed -= new RadPopupClosedEventHandler(this.OnEditorElementPopupClosed); editorElement.Validating -= new CancelEventHandler(this.OnEditorElementValidating); editorElement.Validated -= new EventHandler(this.OnEditorElementValidated); editorElement.ValidationError += new ValidationErrorEventHandler(this.OnEditorElementValidationError); return(base.EndEdit()); }
public override void BeginEdit() { base.BeginEdit(); RadTimePickerElement editorElement = this.EditorElement as RadTimePickerElement; editorElement.RightToLeft = this.RightToLeft; editorElement.MaskedEditBox.TextBoxItem.KeyDown += new KeyEventHandler(this.OnTextBoxItemKeyDown); editorElement.ValueChanged += new EventHandler(this.OnEditorElementValueChanged); editorElement.ValueChanging += new CancelEventHandler(this.OnEditorElementValueChanging); editorElement.PopupClosed += new RadPopupClosedEventHandler(this.OnEditorElementPopupClosed); editorElement.Validating += new CancelEventHandler(this.OnEditorElementValidating); editorElement.Validated += new EventHandler(this.OnEditorElementValidated); editorElement.ValidationError += new ValidationErrorEventHandler(this.OnEditorElementValidationError); (editorElement.MaskedEditBox.Provider as MaskDateTimeProvider).SelectFirstEditableItem(); editorElement.MaskedEditBox.TextBoxItem.HostedControl.Focus(); }
public override void InitializeEditor(IInputEditor editor) { RadDateTimeEditor radDateTimeEditor = editor as RadDateTimeEditor; if (radDateTimeEditor != null) { RadDateTimePickerElement editorElement = (RadDateTimePickerElement)radDateTimeEditor.EditorElement; editorElement.Format = this.Format; editorElement.CustomFormat = this.CustomFormat; editorElement.Culture = this.FormatInfo; editorElement.ShowUpDown = this.EditorType == GridViewDateTimeEditorType.DateTimePickerSpinMode; } GridTimePickerEditor timePickerEditor = editor as GridTimePickerEditor; if (timePickerEditor == null) { return; } RadTimePickerElement editorElement1 = timePickerEditor.EditorElement as RadTimePickerElement; editorElement1.Format = this.Format != DateTimePickerFormat.Custom ? this.FormatString : this.CustomFormat; editorElement1.Culture = this.FormatInfo; }
protected override void CreateChildItems(RadElement parent) { base.CreateChildItems(parent); this.timePickerElement = this.CreateTimePickerElement(); parent.Children.Add((RadElement)this.timePickerElement); }