Skip to content

syncfusion/wpf-ui-components-skills / skills/syncfusion-wpf-datetimepicker

syncfusion-wpf-datetimepicker

Verified

Implements the Syncfusion WPF DateTimeEdit (DateTimePicker) control for date and time selection with dropdown calendar/clock support. Use this when adding datetime pickers, masked datetime input, or datetime selection controls in WPF applications. Covers DateTime binding, mask/free-form editing, pattern formatting, CultureInfo localization, dropdown views, date range restrictions, blackout dates, null value handling, watermarks, and theming with SfSkinManager.

Implementing DateTimeEdit (WPF)

An enhanced date-time input control with mask editing, calendar/clock dropdown, date range restriction, formatting, and MVVM binding support.

When to Use This Skill

Use this skill when the user needs to:

  • Add a date/time picker input field to a WPF application
  • Bind a selected date to a ViewModel property (DateTime two-way binding)
  • Format the displayed date/time (predefined patterns or custom patterns)
  • Restrict selectable dates with min/max range or blackout dates
  • Enable inline editing (mask mode or free-form text editing)
  • Show a calendar, clock, or combined dropdown picker
  • Display watermark text when no date is selected
  • Handle null date values
  • Apply locale-specific date formats via CultureInfo
  • Localize dropdown button labels (Today/None)

Component Overview

ClassNamespaceAssembly
DateTimeEditSyncfusion.Windows.SharedSyncfusion.Shared.WPF

XAML Namespace:

xmlns:syncfusion="http://schemas.syncfusion.com/wpf"

NuGet:

Install-Package Syncfusion.Shared.WPF

Documentation and Navigation Guide

Getting Started

πŸ“„ Read: references/getting-started.md

  • Assembly setup and XAML namespace
  • Add via designer, XAML, or C#
  • Setting DateTime value
  • Two-way MVVM binding with DateTimeChanged event
  • Predefined Pattern quick reference
  • MinDateTime / MaxDateTime basics
  • SfSkinManager theme setup

DateTime Editing

πŸ“„ Read: references/datetime-editing.md

  • Mask editing (default) β€” field-by-field input with auto-validation
  • Keyboard navigation between date/time fields
  • Free-form text editing (CanEdit="True")
  • Mouse wheel value change (EnableMouseWheelEdit)
  • Up/down repeat buttons (IsVisibleRepeatButton, IsEnabledRepeatButton)
  • Custom repeat button UI templates
  • Alpha key month navigation (EnableAlphaKeyNavigation)
  • BackSpace/Delete key editing
  • OnFocusBehavior and AutoForwarding focus control

Formatting & Culture

πŸ“„ Read: references/formatting-and-culture.md

  • All 11 predefined Pattern values
  • CustomPattern with Pattern="CustomPattern"
  • DateTimeFormat with DateTimeFormatInfo
  • CultureInfo for locale-specific formatting
  • PatternChanged / CustomPatternChanged events

Dropdown Popup

πŸ“„ Read: references/dropdown-popup.md

  • DropDownView: Calendar / Clock / Combined
  • Keyboard shortcuts (Alt+Down, F4)
  • TodayButtonAction (Date vs DateTime)
  • IsEmptyDateEnabled β€” None button / reset to null
  • AbbreviatedMonthNames / ShortestDayNames
  • PopupDelay, IsButtonPopUpEnabled
  • DropDownButtonTemplate custom UI
  • Custom calendar and clock (SfDateSelector / SfTimeSelector)
  • TimeStepInterval for clock

Date Restrictions & Null Values

πŸ“„ Read: references/date-restrictions.md

  • MinDateTime / MaxDateTime β€” prevent out-of-range selection
  • BlackoutDates β€” block specific date ranges
  • DisableDateSelection β€” month/year only
  • IsReadOnly β€” prevent all user edits
  • NullValue / IsEmptyDateEnabled / ShowMaskOnNullValue
  • NoneDateText watermark

Appearance

πŸ“„ Read: references/appearance.md

  • Foreground, Background, SelectionBrush
  • FocusedBorderBrush
  • FlowDirection RTL
  • Repeat button background and margins
  • SfSkinManager themes list

Localization

πŸ“„ Read: references/localization.md

  • CurrentUICulture setup
  • Resource file naming: Syncfusion.Shared.Wpf.{culture}.resx
  • Name/Value pairs for Today/None button labels
  • French culture example

Quick Start Example

<!-- MainWindow.xaml -->
<Window xmlns:syncfusion="http://schemas.syncfusion.com/wpf">
    <Window.DataContext>
        <local:ViewModel/>
    </Window.DataContext>
    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
        <syncfusion:DateTimeEdit DateTime="{Binding SelectedDate, Mode=TwoWay}"
                                 Pattern="ShortDate"
                                 MinDateTime="01/01/2020"
                                 MaxDateTime="12/31/2030"
                                 Height="25" Width="200"
                                 Name="dateTimeEdit"/>
    </StackPanel>
</Window>
// ViewModel.cs
public class ViewModel : NotificationObject
{
    private DateTime _selectedDate = DateTime.Now;
    public DateTime SelectedDate
    {
        get => _selectedDate;
        set { _selectedDate = value; RaisePropertyChanged(nameof(SelectedDate)); }
    }
}

Common Patterns

ScenarioProperties / Approach
Two-way date bindingDateTime="{Binding SelectedDate, Mode=TwoWay}"
Show calendar + clockDropDownView="Combined" Pattern="FullDateTime"
Free-form text editingCanEdit="True"
Date-only range restrictionMinDateTime="..." MaxDateTime="..."
Allow null / clear valueIsEmptyDateEnabled="True" NullValue="{x:Null}" ShowMaskOnNullValue="False"
Watermark when nullAdd NoneDateText="Select a date" alongside null value properties
Custom date displayPattern="CustomPattern" CustomPattern="dd-MMM-yyyy"
Culture-aware formattingCultureInfo="fr-FR" Pattern="FullDateTime"
Read-only inputIsReadOnly="True"
RTL layoutFlowDirection="RightToLeft"
Apply themeSfSkinManager.SetVisualStyle(dte, VisualStyles.FluentLight)

Key Properties

PropertyTypeDefaultDescription
DateTimeDateTimeDateTime.NowSelected date/time value
PatternDateTimePatternShortDateDisplay format pattern
CustomPatternstringnullCustom format string (requires Pattern="CustomPattern")
CultureInfoCultureInfoSystem cultureLocale for date formatting
CanEditboolfalseEnable free-form text editing
MinDateTimeDateTimeDateTime.MinValueMinimum selectable date
MaxDateTimeDateTimeDateTime.MaxValueMaximum selectable date
DropDownViewDropDownViewsCalendarPopup content: Calendar/Clock/Combined
IsEmptyDateEnabledboolfalseAllow null date value
NullValueDateTime?nullValue when date is cleared
NoneDateTextstring""Watermark text when value is null
ShowMaskOnNullValuebooltrueShow mask vs watermark when null
IsReadOnlyboolfalsePrevent user edits
IsVisibleRepeatButtonboolfalseShow up/down spinner buttons
EnableMouseWheelEditbooltrueAllow mouse wheel to change value
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall