Hi Ryan,
Thank you for your input.
I have changed the item status to "Declined" as we think this is not a valid feature request for the default look of the DateTimePicker control.
If you want to customize the default look of the control you can use the provided templates. In order to add a clear button inside the picket's popup footer, you can use the FooterTemplate. Example:
DateTimePicker definition:
<telerikInput:RadDateTimePicker Date="{Binding Value}" x:Name="picker">
<telerikInput:RadDateTimePicker.SelectorSettings>
<telerikInput:PickerPopupSelectorSettings FooterTemplate="{StaticResource PickerFooterTemplate}" />
</telerikInput:RadDateTimePicker.SelectorSettings>
</telerikInput:RadDateTimePicker>
In order to clear the selection you can use one of the following approaches:
1) ClearSelection method - the footer template definition and additional clear button
<ControlTemplate x:Key="PickerFooterTemplate">
<StackLayout Orientation="Horizontal"
Spacing="0"
HorizontalOptions="FillAndExpand">
<Button Text="Clear"
BackgroundColor="Transparent"
Clicked="Button_Clicked"/>
<Button Text="{TemplateBinding AcceptButtonText}"
BackgroundColor="Transparent"
Command="{TemplateBinding AcceptCommand}" />
<Button Text="{TemplateBinding CancelButtonText}"
BackgroundColor="Transparent"
Command="{TemplateBinding CancelCommand}" />
</StackLayout>
</ControlTemplate>
call clearselection method inside the button click event.
private void Button_Clicked(object sender, EventArgs e) { this.picker.ClearSelection(); }
2) Clear Command - footer template definition:
<ControlTemplate x:Key="PickerFooterTemplate">
<StackLayout Orientation="Horizontal"
Spacing="0"
HorizontalOptions="FillAndExpand">
<Button Text="Clear"
BackgroundColor="Transparent"
Command="{Binding Source={x:Reference picker}, Path=ClearCommand}"/>
<Button Text="{TemplateBinding AcceptButtonText}"
BackgroundColor="Transparent"
Command="{TemplateBinding AcceptCommand}" />
<Button Text="{TemplateBinding CancelButtonText}"
BackgroundColor="Transparent"
Command="{TemplateBinding CancelCommand}" />
</StackLayout>
</ControlTemplate>
Nullable DateTime
Regarding the "nullable date time", this scenario could be achieved using DateTimePicker.Date property. The date property is of type DateTime? and its default value is null. For more information please check the Selection article from our documentation.
Regards,
Didi
Progress Telerik