Represents the main element that provides the time span picker functionality, serving as the core implementation for the RadTimeSpanPicker control with support for masked text input and popup-based editing.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadTimeSpanPickerElement : PopupEditorBaseElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IInputEditor, IValueEditor, ISupportInitialize, ITimeSpanPickerContentElementOwner
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadEditorElementEditorBaseElementPopupEditorBaseElementRadTimeSpanPickerElement...
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadTimeSpanPickerElement class with default settings.
public RadTimeSpanPickerElement()
Fields
Identifies the PopupMinSize dependency property that specifies the minimum size constraints for the popup window.
public static RadProperty PopupMinSizeProperty
Properties
Gets or sets the culture information used for formatting and parsing time span values. This affects how time components are displayed and interpreted based on regional settings.
public CultureInfo Culture { get; set; }
Implements:
Gets or sets the increment step for the days component when modifying time span values using spin buttons or keyboard navigation.
public int DaysStep { get; set; }
Gets the button element used to decrease time span component values.
public RadRepeatArrowElement DownButton { get; }
Gets or sets a value indicating whether the popup displays with animation effects when opening and closing.
public bool DropDownAnimationEnabled { get; set; }
Gets the dropdown button element that opens the time span selection popup when clicked.
public RadTimeDropDownButtonElement DropDownButton { get; }
Gets or sets the edit mode that determines how users can interact with the control to modify time span values. This property controls whether editing is done through text input, popup interface, or both.
public TimeSpanEditMode EditMode { get; set; }
Gets or sets the editor element reference. This property is hidden from serialization to prevent stack overflow exceptions
public override RadItem EditorElement { get; set; }
Overrides:
Gets or sets a value indicating whether users can set the time span value to null using keyboard shortcuts. When enabled, users can press Ctrl+Del or Ctrl+0 to clear the current value.
public virtual bool EnableNullValueInput { get; set; }
Gets or sets the format string that determines how time span values are displayed and parsed in the text input. The format string controls which time components are shown and their formatting patterns.
public string Format { get; set; }
Implements:
Gets or sets the increment step for the hours component when modifying time span values using spin buttons or keyboard navigation.
public int HoursStep { get; set; }
Gets the masked edit box element that provides text input functionality with time span validation and formatting.
public virtual RadMaskedEditBoxElement MaskedEditBox { get; }
Gets or sets the maximumvalue that can be selected in the control. Values above this maximum will not be accepted or displayed.
public TimeSpan MaxValue { get; set; }
Gets or sets the increment step for the milliseconds component when modifying time span values using spin buttons or keyboard navigation.
public int MillisecondsStep { get; set; }
Gets or sets the increment step for the minutes component when modifying time span values using spin buttons or keyboard navigation.
public int MinutesStep { get; set; }
Gets or sets the minimumvalue that can be selected in the control. Values below this minimum will not be accepted or displayed.
public TimeSpan MinValue { get; set; }
Gets or sets the placeholder text displayed when the control has no time span value set. This text provides guidance to users about the expected input format.
public string NullText { get; set; }
Gets the popup content element that provides the interactive time span selection interface within the popup.
public virtual ITimeSpanPickerContentElement PopupContentElement { get; }
Gets the popup form that contains the time span selection interface.
public RadTimeSpanPickerPopup PopupForm { get; }
Gets or sets the minimum size constraints for the popup window that contains the time span selection interface.
public Size PopupMinSize { get; set; }
Gets or sets a value indicating whether the control is in read-only mode. When true, users cannot modify the time span value through either text input or popup interaction.
[Browsable(false)]
public bool ReadOnly { get; set; }
Gets or sets the increment step for the seconds component when modifying time span values using spin buttons or keyboard navigation.
public int SecondsStep { get; set; }
Gets or sets a value indicating whether the dropdown button that opens the popup is visible and accessible to users.
public bool ShowDropDownButton { get; set; }
Gets or sets a value indicating whether the spin buttons for incrementing and decrementing time span components are visible. When enabled, users can use up/down buttons to modify the selected time component.
public bool ShowSpinButtons { get; set; }
Gets the stack layout element that serves as a container for the spin buttons (up and down arrows).
public StackLayoutElement SpinButtonsStackLayout { get; }
Gets or sets the text alignment of within the masked edit box.
public HorizontalAlignment TextAlign { get; set; }
Gets the type used for theming this element, allowing it to inherit styles from RadTimePickerElement.
protected override Type ThemeEffectiveType { get; }
Overrides:
Gets the mask provider that manages time span formatting and editing behavior for the masked edit box. This provider controls how editing is performed for each time component (days, hours, minutes, seconds, milliseconds).
public MaskTimeSpanProvider TimeSpanProvider { get; }
Implements:
Gets the increment button element used to increase time span component values.
public RadRepeatArrowElement UpButton { get; }
Gets or sets the value of the RadTimeSpanPickerElement. The value can be null if no time span is selected or if null input is enabled.
public override object Value { get; set; }
Overrides:
Implements:
Methods
Closes the popup window when called by the popup content element.
public void CloseOwnerPopup()
Implements:
Creates the stack layout element that serves as a container for the up and down arrow buttons.
protected virtual StackLayoutElement CreateButtonsStack()
A new instance of StackLayoutElement configured for vertical button arrangement.
Creates and initializes all child elements including the masked edit box, dropdown button, spin buttons, and layout containers.
protected override void CreateChildElements()
Overrides:
Creates the decrement button element used to decrease time span component values.
protected virtual RadRepeatArrowElement CreateDownButton()
A RadRepeatArrowElement configured as a down arrow button.
Creates the dropdown button element that opens the time span selection popup when clicked.
protected virtual RadTimeDropDownButtonElement CreateDropDownButtonElement()
A new instance of RadTimeDropDownButtonElement.
Creates the masked edit box element that provides text input functionality with time span validation and formatting.
protected virtual RadMaskedEditBoxElement CreateMaskedEditBoxElement()
A new instance of RadMaskedEditBoxElement configured for time span input.
Creates the popup form instance that contains the time span selection interface. Override this method to provide a popup with specialized content for time span selection.
protected override RadPopupControlBase CreatePopupForm()
A new instance of RadTimeSpanPickerPopup configured for this element.
Overrides:
Creates the increment button element used to increase time span component values.
protected virtual RadRepeatArrowElement CreateUpButton()
A RadRepeatArrowElement configured as an up arrow button.
Releases managed resources by unsubscribing from events and disposing child elements.
protected override void DisposeManagedResources()
Overrides:
Calculates and returns the optimal size for the popup based on its content and minimum size constraints.
protected override Size GetPopupSize(RadPopupControlBase popup, bool measure)
The popup control to calculate size for.
measureboolIndicates whether to perform measurement calculations.
Returns:A Size representing the calculated popup dimensions.
Overrides:
Initializes the default field values for the time span picker element.
protected override void InitializeFields()
Overrides:
Handles the key down event from the masked edit box and forwards it to subscribers.
protected virtual void MaskEditBox_KeyDown(object sender, KeyEventArgs e)
The source of the event.
eKeyEventArgsEvent data containing key information.
Handles the key press event from the masked edit box and forwards it to subscribers.
protected virtual void MaskEditBox_KeyPress(object sender, KeyPressEventArgs e)
The source of the event.
eKeyPressEventArgsEvent data containing key press information.
Handles the mouse up event from the masked edit box and forwards it to subscribers.
protected virtual void MaskEditBox_MouseUp(object sender, MouseEventArgs e)
The source of the event.
eMouseEventArgsEvent data containing mouse information.
Handles the mouse wheel event from the masked edit box and forwards it to subscribers.
protected virtual void MaskEditBox_MouseWheel(object sender, MouseEventArgs e)
The source of the event.
eMouseEventArgsEvent data containing mouse wheel information.
Measures the desired size of the element within the available space, ensuring proper layout constraints are respected.
Handles the element loaded event to configure the masked edit box border visibility.
protected override void OnLoaded()
Overrides:
Handles the popup closed event to update element states and clear popup content selection.
protected virtual void OnPopupClosed(object sender, RadPopupClosedEventArgs args)
The source of the event.
argsRadPopupClosedEventArgsEvent data for the popup closed event.
Handles the popup closing event and prevents premature closure when the mouse is over the dropdown button.
protected override void OnPopupClosing(RadPopupClosingEventArgs e)
Event data containing close reason and cancellation information.
Overrides:
Handles property change events and updates RTL support for child elements when the RightToLeft property changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Event data containing property change information.
Overrides:
Handles the value changing event from the masked edit box and forwards it to subscribers.
protected virtual void OnValueChanging(object sender, CancelEventArgs e)
The source of the event.
eCancelEventArgsEvent data containing cancellation information.
Configures the element's behavior based on the specified edit mode, controlling text box read-only state and button visibility.
protected virtual void SetupEditMode(TimeSpanEditMode timeSpanEditMode)
The edit mode to apply to the element.
Unsubscribes from all previously subscribed events to prevent memory leaks and unwanted event handling.
protected virtual void UnwireEvents()
Updates the localization strings used in the popup content to reflect the current localization provider settings.
protected virtual void UpdatePopupLocalizationStrings()
Subscribes to necessary events from child elements and external providers to coordinate element behavior.
protected virtual void WireEvents()
Events
Occurs when the element is clicked.
public event EventHandler Click
Occurs when the user presses a key while the element has focus.
public event KeyEventHandler KeyDown
Occurs when the user presses and releases a key while the element has focus.
public event KeyPressEventHandler KeyPress
Occurs when the user releases a key while the element has focus.
public event KeyEventHandler KeyUp
Occurs when the user releases a mouse button while the mouse pointer is over the element.
public event MouseEventHandler MouseUp
Occurs when the mouse wheel moves while the element has focus.
public event MouseEventHandler MouseWheel
Occurs when the time span value has been successfully changed.
public event EventHandler ValueChanged
Occurs when the time span value is about to be changed and allows the operation to be canceled.
public event CancelEventHandler ValueChanging