We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set Different pattern in DatetimeEdit Control?

To set the different pattern for the dates in the DateTimeEdit control, the Pattern property can be used. The Pattern property consist of different values, as follows below:

  • Custom pattern
  • Short Date
  • FullDateTime
  • LongDate
  • LongTime
  • MonthDay
  • RFC1123
  • ShortDate
  • ShortTime
  • SortableDateTime
  • UniversableSortableDateTime
  • YearMonth

The following code snippet shows how to set the YearMonth pattern in the DateTimeEdit control using Pattern property. Similarly, the different patterns can be set using the Pattern property.

XAML:

 

C#:

 

Output:

The following output shows the Year and Month by setting YearMonth pattern

 

               

 

Article ID: Published Date: Last Revised Date: Platform: Control:
6791 05/04/2016 05/04/2016 WPF DateTimeEdit
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon