Hi,
When the user opens the picker for the first time, is there any way to have it default to the current time?
I know I can set DefaultHighlightedTime but the user may spend some minutes in the screen before they select a time so the DefaultHighlightedTime is no longer the current time and is a few minutes ago.
Regards
Anthony
4 Answers, 1 is accepted
Hello Anthony,
You can achieve this using DateTimePicker in Time picker mode and bind the DefaultHighlightedDate to a property inside the ViewModel which returns DateTime.Now. When you press cancel and open the picker again the defaulthighlight date will be changed to the current DateTime.
I have created a sample to show you how this could be achieved. Download the file and test on your side.
I hope the provided information was helpful.
Regards,
Didi
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi,
Thanks, that does work however the placeholder text now looks very different because of the new ControlTemplate. Do you have the default values for this so I can set them to match other controls?
Regards
Anthony
Hello Anthony,
This is the default placeholder template:
<ControlTemplate x:Key="Picker_PlaceholderView_ControlTemplate">
<Grid>
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{TemplateBinding ToggleCommand}" />
</Grid.GestureRecognizers>
<Label Text="{TemplateBinding Placeholder}"
Style="{TemplateBinding PlaceholderLabelStyle}"
AutomationId="PickerPlaceholderLabel"/>
</Grid>
</ControlTemplate>
Regards,
Didi
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi,
Thanks for that.
Regards
Anthony