Duplicated
Last Updated: 25 Oct 2023 08:13 by ADMIN
Marcel
Created on: 24 Oct 2023 15:53
Category: UI for .NET MAUI
Type: Feature Request
0
DatePicker with calendar for selection

I would love to have an option to display a calendar in the DatePicker date selection popup

 

Best regards,

 

 

Marcel Souza

Pds Informática

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
1 comment
ADMIN
Yana
Posted on: 25 Oct 2023 08:13

Hi Marcel,

The .NET MAUI DatePicker control can show the date components only in spinners, it does not provide month-like view. We have a feature request logged here for such a functionality (that's why I marked this feature request as "Duplicated"), you can check it at the link below:

DateTimePicker: Provide an option to display calendar inside the dropdown

In the meantime, you can use our RadTemplatePicker in combination with RadCalendar to achieve similar look & feel, here is a quick sample:

<telerik:RadTemplatedPicker x:Name="picker"
                            Placeholder="Select a Date"                                    
                            PickerMode="Popup">
    <telerik:RadTemplatedPicker.SelectorTemplate>
        <ControlTemplate>
            <telerik:RadCalendar x:Name="calendar" SelectedDate="{TemplateBinding SelectedValue, Mode=TwoWay, Converter={StaticResource StringToDateTimeConverter}}" />
        </ControlTemplate>
    </telerik:RadTemplatedPicker.SelectorTemplate>
</telerik:RadTemplatedPicker>

And the converter:

public class StringToDateTimeConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return value;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is DateTime selectedDate)
        {
            return selectedDate.ToString("yyyy/MMM/dd");
        }
        return null;
    }             
}

I hope this approach would be acceptable. 

Regards,
Yana
Progress Telerik

A brand new .NET MAUI course was just added to the Virtual Classroom. The training course is developed to help you get started with the Telerik UI for .NET MAUI components and features. It aims to put you in the shoes of an engineer who adds new features to an existing application. You can check it out at https://learn.telerik.com