This section explains how to add the Date Time Picker control. It covers only the basic features needed to get started with Syncfusion® Date Time Picker.
Make sure to add the namespace.
{% highlight MauiProgram.cs %} using Syncfusion.Maui.Core.Hosting; {% endhighlight %}
Register the Syncfusion core handler in your CreateMauiApp method of MauiProgram.cs file to use Syncfusion controls.
{% highlight MauiProgram.cs %} builder.ConfigureSyncfusionCore(); {% endhighlight %}
Add the following namespace in your XAML or C#.
{% tabs %} {% highlight xaml tabtitle="xaml" %} xmlns:picker="clr-namespace:Syncfusion.Maui.Picker;assembly=Syncfusion.Maui.Picker" {% endhighlight %} {% highlight c# tabtitle="C#" %} using Syncfusion.Maui.Picker; {% endhighlight %} {% endtabs %}
Create an instance of DateTimepicker and add it to your page.
{% tabs %} {% highlight xaml tabtitle="XAML" %} <picker:SfDateTimePicker /> {% endhighlight %} {% highlight c# tabtitle="C#" %} SfDateTimePicker picker = new SfDateTimePicker(); this.Content = picker; {% endhighlight %} {% endtabs %}
The following gif image illustrates the result of the above code.
N> You can refer to our .NET MAUI Date Time Picker feature tour page for its groundbreaking feature representations. You can also explore our .NET MAUI Date Time Picker Example that shows you how to render the Date Time Picker in .NET MAUI.
