A component for selecting date and time with an input and popup calendar/time selector. Configure format via Format (default ), width through Width, and steps using DateTimePickerSteps. Supports open/close events (OnOpen/OnClose), calendar cell rendering via OnCalendarCellRender, week numbers (ShowWeekNumbers), auto switching/correction (AutoSwitchParts, AutoSwitchKeys, AutoCorrectParts), two–digit year handling (TwoDigitYearMax), and caret input mode (AllowCaretMode). Programmatic API: CloseAsync() and Close().
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Type Parameters:
T
Syntax:
public class TelerikDateTimePicker<T> : TelerikPickerBase<T>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseBaseComponentTelerikInputBase<T>TelerikPickerBase<T>TelerikDateTimePicker<T>...
Implements:
Inherited Members
Constructors
public TelerikDateTimePicker()
Methods
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Overrides:
Closes the component.
public override void Close()
Overrides:
Hides the picker popup.
protected override void OnParametersSet()
Overrides:
Properties
Specifies if a caret can be displayed during input (when possible).
[Parameter]
public bool AllowCaretMode { get; set; }
Specifies if date parts will be auto corrected.
[Parameter]
public bool AutoCorrectParts { get; set; }
Specifies which keys should switch date parts.
[Parameter]
public List<object> AutoSwitchKeys { get; set; }
Specifies if date parts will be automatically switched when completed.
[Parameter]
public bool AutoSwitchParts { get; set; }
Provides configuration for WebMCP tools, such as a Name to distinguish this DateTimePicker from others on the same page.
[Parameter]
public RenderFragment DateTimePickerSettings { get; set; }
Enables WebMCP tool registration for this DateTimePicker.
When true, DateTimePicker operations are exposed as tools discoverable by AI models through the browser.
Default value is false.
[Parameter]
public bool EnableWebMcpTools { get; set; }
Specifies the format of the DateInput of the DateTimePicker.
[Parameter]
public override string Format { get; set; }
Overrides:
Fires each time a calendar cell renders. Use the event to add a custom CSS class to each calendar cell based on its value.
[Parameter]
public Action<DateTimePickerCalendarCellRenderEventArgs> OnCalendarCellRender { get; set; }
Defines the OnClose Event which is fired before the popup of the DateTimePicker is closed.
[Parameter]
public EventCallback<DateTimePickerCloseEventArgs> OnClose { get; set; }
Defines the OnOpen Event which is fired before the popup of the DateTimePicker is opened.
[Parameter]
public EventCallback<DateTimePickerOpenEventArgs> OnOpen { get; set; }
Defines if additional week number column is added.
[Parameter]
public bool ShowWeekNumbers { get; set; }
Specifies the maximum year to assume to be from the current century when typing two-digit year value. The default value is 68, indicating that typing any value less than 69 will be assumed to be 20xx, while 69 and larger will be assumed to be 19xx.
[Parameter]
public int TwoDigitYearMax { get; set; }