#364 – Allowing a User to Select Multiple Dates in a Calendar Control

By default, the Calendar control allows a user to select a single date.  You can set the SelectionMode property to allow the user to select more than one date.

SelectionMode (CalendarSelectionMode enumeration) can have one of the following values:

  • None – user can’t select date
  • SingleDate – select a single date  (default)

  • SingleRange – select a contiguous range of dates

  • MultipleRange – select multiple ranges of dates

If the SelectionMode is SingleDate, the SelectedDate property (DateTime) will contain the selected date.

If the SelectionMode is SingleRange or MultipleRange, the SelectedDates property (ObservableCollection of DateTime) will contain all of the selected dates.  The SelectedDate property will contain a copy of the first date in the SelectedDates collection.

Advertisements

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

2 Responses to #364 – Allowing a User to Select Multiple Dates in a Calendar Control

  1. Pingback: Dew Drop – August 15, 2011 | Alvin Ashcraft's Morning Dew

  2. zafer says:

    Hi. Why does the current time(4) remain selected when we select a date in single date mode? I want only one history to be chosen.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: