EditorBaseElement
Base class for in-place editor elements, providing value storage, formatting/parsing hooks and validation events shared by all editor types.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[RadToolboxItem(false)]
public abstract class EditorBaseElement : RadEditorElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IInputEditor, IValueEditor, ISupportInitialize
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadEditorElementEditorBaseElement...
Derived Classes:
Implements:
Inherited Members
Constructors
protected EditorBaseElement()
Fields
Receives keyboard and value-change notifications forwarded from this editor element to its host.
protected IEditorHandler EditorHandler
Stores the value loaded during initialization for modification checks and validation rollback.
protected object originalValue
Properties
Gets or sets the value assigned to the editor when it is initialized without an explicit value.
public object DefaultValue { get; set; }
Gets or sets the child element that hosts the actual input UI; defaults to the editor itself.
public virtual RadItem EditorElement { get; set; }
Gets or sets the manager associated with this editor for host-specific editor selection and lifecycle coordination.
public IEditorManager EditorManager { get; set; }
Implements:
Gets the identifier used to register and look up this editor type in the editor manager.
public virtual string EditorType { get; }
Gets true for the editor element. Assignments are ignored by this base implementation.
public virtual bool Focusable { get; set; }
Reports the enabled state of this input element through its underlying Enabled property.
public bool IsEnabled { get; }
Gets whether the editor's value has changed since it was initialized.
public virtual bool IsModified { get; }
Implements:
Gets whether this editor element currently owns mouse capture.
public bool IsMouseCaptured { get; }
Gets whether the editor is instantiated on demand or is always availabele. Example: GridBooleanCellElement and GridViewBooleanColumn.
public virtual bool IsNestedEditor { get; }
Gets or sets the upper bound accepted by the editor, when range validation is supported.
public virtual object MaxValue { get; set; }
Gets or sets the lower bound accepted by the editor, when range validation is supported.
public virtual object MinValue { get; set; }
Gets or sets the value treated as representing a null/empty entry for this editor.
public object NullValue { get; set; }
Gets the value category reported to the host; the base editor reports AlphaNumeric.
public virtual EditorSupportedType SupportedType { get; }
Gets or sets the editor's current, unformatted value.
public virtual object Value { get; set; }
Implements:
Gets the visual mode reported to the host; the base editor reports Default.
public virtual EditorVisualMode VisualMode { get; }
Methods
Begins an editing session after the editor has been initialized.
public virtual void BeginEdit()
Implements:
Signals that batch initialization is starting, suspending validation until EndInit() is called.
public virtual void BeginInit()
Implements:
Ends the current editing session.
public virtual bool EndEdit()
Whether the implementation completed the end-edit operation.
Implements:
Signals that batch initialization has completed, resuming normal validation behavior.
public virtual void EndInit()
Implements:
Gets the VisualElement that must receive the focus, when the editor is invoked.
Initializes the provider.
public virtual void Initialize()
Initializes the provider.
public virtual void Initialize(object value)
value to be pre-loaded inside the initialized editor.
Uses this element as its own input element until a specialized editor supplies a separate one.
protected override void InitializeFields()
Overrides:
Raises Format with the conversion event data.
protected virtual void OnFormat(ConvertEventArgs e)
The value and target type involved in the conversion.
Forwards the key to EditorHandler when editor-handler routing is enabled; otherwise, uses the base key handler.
protected override void OnKeyDown(KeyEventArgs e)
The key event data.
Overrides:
Forwards the key to EditorHandler when editor-handler routing is enabled, then runs the base key-up handler.
protected override void OnKeyUp(KeyEventArgs e)
The key event data.
Overrides:
Raises Parse with the conversion event data.
protected virtual void OnParse(ConvertEventArgs e)
The displayed value and target type involved in the conversion.
Raises the cancelable QueryValue notification used by popup editors before closing for reasons other than CloseCalled.
protected virtual void OnQueryValue(CancelEventArgs e)
The cancellation state that can be set by a query handler.
Raises value-changed notifications after base text handling, unless initialization suppresses them.
protected override void OnTextChanged(EventArgs e)
The event data supplied by the text element.
Overrides:
Converts an accepted text change to a cancelable value change and propagates cancellation back to the text edit.
protected override void OnTextChanging(TextChangingEventArgs e)
The proposed text and its cancellation state.
Overrides:
Raises Validating with the proposed value so handlers can cancel validation.
protected virtual void OnValidating(ValueChangingEventArgs e)
The proposed value and cancellation state.
Wraps the message in an Exception and raises ValidationError.
protected virtual void OnValidationError(string message)
The error message to include in the validation exception.
Raises ValidationError with the supplied error information.
protected virtual void OnValidationError(ValidationErrorEventArgs args)
The value and exception associated with the validation error.
Notifies the host and local subscribers after a value change, except while initialization notifications are suppressed.
protected virtual void OnValueChanged(EventArgs args)
The value-changed event data.
Notifies the host and local subscribers before a value change; initialization suppresses these notifications, and host cancellation prevents the local event from being raised.
protected virtual void OnValueChanging(ValueChangingEventArgs args)
The proposed value and cancellation state.
Routes a key-down event to this element's key-down handler, including its editor-host forwarding logic.
Routes a key-press event to this element's key-press handler.
public void ProcessKeyPress(KeyPressEventArgs e)
The key-press event data.
Routes a key-up event to this element's key-up handler, including its editor-host forwarding logic.
Routes a mouse-down event to this element's mouse-down handler.
Routes a mouse-enter event to this element's mouse-enter handler.
Routes a mouse-leave event to this element's mouse-leave handler.
Routes a mouse-move event to this element's mouse-move handler.
Routes a mouse-up event to this element's mouse-up handler.
Routes a mouse-wheel event to this element's mouse-wheel handler.
Releases mouse capture from this editor element.
public void ReleaseMouseCapture()
Runs validation for the current editor value.
public virtual bool Validate()
The validation result reported by the concrete editor implementation.
Implements:
Implementations differ when validation is canceled: BaseInputEditor returns false, while
EditorBaseElementrestores the initialized value and returns true.
Raises validation notifications; cancellation raises ValidationError and restores the initialized value.
protected virtual void ValidateCore()
Events
Occurs when the underlying value is converted to its display representation, allowing custom formatting.
public event ConvertEventHandler Format
Occurs when the displayed text is converted back to the underlying value, allowing custom parsing.
public event ConvertEventHandler Parse
Occurs when the current value is requested, allowing a handler to supply or override it.
public event CancelEventHandler QueryValue
Occurs after the editor's value has passed validation.
public event EventHandler Validated
Implements:
Occurs before the editor's value is validated, allowing validation to be canceled.
public event CancelEventHandler Validating
Implements:
Occurs when internally the editor detects an error or when the Validating event fails.
public event ValidationErrorEventHandler ValidationError
Implements:
Occurs after the editor value changes, except while initialization notifications are suppressed.
[Browsable(true)]
public event EventHandler ValueChanged
Implements:
Reserved for future use; not currently raised.
public event ValueChangingEventHandler ValueChanging
Implements: