Hello:
As the subject line states, is there a way to open the DatePicker programmatically?
I use TelerikDateTimePicker and clients of my application send me a lot of issues with TelerikDateTimePicker.
1). If user types in values (date and time) quickly, user will be redirected to the end of input field e.g. type in year 2023 as fast as possible -> only one or two first digits will be filled, other digits will be typed in the end of the field
2) After user manually enters month, year is not selected automatically. Users want the same behaviour as we have with day, year, hours, minutes:
3) After user finishes entering all valid values Date & Time and clicks outside the input field (TelerikDateTimePicker), all entered will be removed.
I use code like:
<label for="selected-date">
TelerikDateTimePicker for enter Date and Time
</label>
<TelerikDateTimePicker
@bind-Value="@SelectedTime"
Min="@Min" Max="@Max"
Format="dd MMM yyyy HH:mm 'Z' (UTC)"
Placeholder="dd MMM yyyy HH:mm 'Z' (UTC)"
Id="selected-date"/>
@code {
DateTime? SelectedTime = null;
DateTime Min { get; set; } = new(1900, 1, 1, 0, 0, 0);
public DateTime Max { get; set; } = new(2099, 12, 31, 23, 59, 59);
}
I also tried to use some combinations of TelerikDateTimePicker properties:
AllowCaretMode="true" AutoCorrectParts="true" AutoSwitchParts="true"
but this only made the behaviour worse
Hello
I want to write a desired text instead of calendar numbers.
For example, as specified in the attached file, I want to write the desired text (8 day of month) instead of the number 8.
I tried through the event:
OnCalendarCellRender="@OnCalendarCellRenderHandler"
but I did not get the result.
Please help me.
Hello
I want to display the desired text in the DatePicker after selecting the date from TelerikDatePicker.
Currently, after selecting the DatePicker, the date is displayed in this field, to which I want to add the desired text.
For example, in the DatePicker field after selecting the date, instead of
07/01/2025
, today is 07/01/2025.
If it is not possible to change the text, at least no text should be displayed in the DatePicker after selecting the date.
Please help me.
Code and image:
<TelerikDatePicker @bind-Value="DatePickerValue" >
</TelerikDatePicker>
@code {
private DateTime DatePickerValue { get; set; } = DateTime.Today;
{
I need to toggle the Enabled state of a TelerikDateTimePicker which resides inside a TelerikPopup based on the checked state of a TelerikCheckBox. This works great outside of a popup, but once in a popup, the Enabled state no longer changes.
Here is a REPL: https://blazorrepl.telerik.com/cIlvvWbC29lZInK522
<div style="padding: 12px;">
<p>Outside popup, toggling checkbox toggles enabled state:</p>
<TelerikDateTimePicker @bind-Value="@SelectedTime"
Format="MM/dd/yyyy hh:mm tt"
ShowWeekNumbers="true"
Id="selected-date" Width="250px" Enabled="@(!chkNowSelected)">
</TelerikDateTimePicker>
<TelerikCheckBox Id="chkNow" @bind-Value="@chkNowSelected" />
<label for="chkNow">Now</label>
</div>
<div style="padding: 12px;">
<p>Inside popup, toggling checkbox does nottoggle enabled state:</p>
<TelerikPopup @ref="@PopupRef"
AnchorSelector=".popup1"
AnimationType="@AnimationType.SlideDown"
AnimationDuration="300"
Width="260px">
<div style="padding: 20px;">
<TelerikDateTimePicker @bind-Value="@SelectedTime"
Format="MM/dd/yyyy hh:mm tt"
ShowWeekNumbers="true"
Id="selected-date" Enabled="@(!chkNowSelected)">
</TelerikDateTimePicker>
<TelerikCheckBox Id="chkNow" @bind-Value="@chkNowSelected" />
<label for="chkNow">Now</label>
</div>
</TelerikPopup>
<TelerikButton OnClick="@OpenPopup" Class="popup1">
Open Popup
</TelerikButton>
</div>
@code {
#nullable enable
private DateTime? SelectedTime = DateTime.Now;
private bool chkNowSelected { get; set; } = true;
private bool EndTimeEnabled { get; set; } = false;
private TelerikPopup? PopupRef { get; set; }
private void OpenPopup()
{
PopupRef?.Show();
}
}
Let's say we have a DateTimePicker two-way bound to a DateTime? value:
<TelerikDatePicker @bind-Value="searchCriteria.specificDate" ShowClearButton="true"></TelerikDatePicker>
public DateTime? specificDate {get; set; }
The user enters an invalid value, such as 1/d/yyyy.
How do you reset it programmatically?
Assigning the bound value to null doesn't do anything, as it's already null.
I don't see a reset method anywhere?
It'd be nice if there was a way to programmatically call whatever is called when the user clicks on the ClearButton.
Thanks.
p.s. This probably applies to all the date/time picker variations.
Hi, my goal is validate a form and focus telerik widget with validation errors.
Now i can find the element search for class "k-invalid" but how to get the widget reference so i can call the FocusAsync() method?
Thanks