New to Telerik UI for WPFStart a free 30-day trial

Represents an input control for selecting a range of two dates.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.Input.dll

Syntax:

C#
[Themable]
[TelerikToolboxCategory("Input")]
public class RadDateRangePicker : Control

Inheritance: objectRadDateRangePicker

Constructors

Initializes a new instance of the RadDateRangePicker class.

C#
public RadDateRangePicker()

Fields

AreWeekNamesVisibleProperty

DependencyProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty AreWeekNamesVisibleProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty AreWeekNumbersVisibleProperty

BlackoutDatesProperty

DependencyProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty BlackoutDatesProperty

CalendarWeekRuleProperty

DependencyProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty CalendarWeekRuleProperty

ClearButtonStyleProperty

DependencyProperty

Identifies the ClearButtonStyle dependency property.

C#
public static readonly DependencyProperty ClearButtonStyleProperty

CultureProperty

DependencyProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty CultureProperty

DatePatternProperty

DependencyProperty

Identifies the DatePattern dependency property.

C#
public static readonly DependencyProperty DatePatternProperty

EmptyContentProperty

DependencyProperty

Identifies the EmptyContent dependency property.

C#
public static readonly DependencyProperty EmptyContentProperty

Identifies the EmptyContentTemplate dependency property.

C#
public static readonly DependencyProperty EmptyContentTemplateProperty

EndDateProperty

DependencyProperty

Identifies EndDate dependency property.

C#
public static readonly DependencyProperty EndDateProperty

FirstDayOfWeekProperty

DependencyProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty FirstDayOfWeekProperty

FormatStringProperty

DependencyProperty

Identifies the FormatString dependency property.

C#
public static readonly DependencyProperty FormatStringProperty

HeaderVisibilityProperty

DependencyProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty HeaderVisibilityProperty

Identifies the IsClearButtonVisible dependency property.

C#
public static readonly DependencyProperty IsClearButtonVisibleProperty

Identifies the IsDefaultRangesPanelVisible dependency property.

C#
public static readonly DependencyProperty IsDefaultRangesPanelVisibleProperty

IsDropDownOpenProperty

DependencyProperty

Identifies the IsDropDownOpen dependency property.

C#
public static readonly DependencyProperty IsDropDownOpenProperty

IsRangeEndProperty

DependencyProperty

Identifies IsRangeEnd attached property.

C#
public static readonly DependencyProperty IsRangeEndProperty

IsRangeStartProperty

DependencyProperty

Identifies IsRangeStart attached property.

C#
public static readonly DependencyProperty IsRangeStartProperty

IsReadOnlyProperty

DependencyProperty

Identifies the IsReadOnly dependency property.

C#
public static readonly DependencyProperty IsReadOnlyProperty

IsTopBarVisibleProperty

DependencyProperty

Identifies the IsTopBarVisible dependency property.

C#
public static readonly DependencyProperty IsTopBarVisibleProperty

PlaceholderProperty

DependencyProperty

Identifies the Placeholder dependency property.

C#
public static readonly DependencyProperty PlaceholderProperty

SelectableDateEndProperty

DependencyProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty SelectableDateEndProperty

SelectableDateStartProperty

DependencyProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty SelectableDateStartProperty

SelectionOnFocusProperty

DependencyProperty

Identifies the SelectionOnFocus dependency property.

C#
public static readonly DependencyProperty SelectionOnFocusProperty

SeparatorProperty

DependencyProperty

Identifies the Separator dependency property.

C#
public static readonly DependencyProperty SeparatorProperty

StartDateProperty

DependencyProperty

Identifies StartDate dependency property.

C#
public static readonly DependencyProperty StartDateProperty

UseShortestDayNamesProperty

DependencyProperty

Identifies the dependency property. The value that indicates whether the week names buttons are using shortest day names.

C#
public static readonly DependencyProperty UseShortestDayNamesProperty

Properties

Gets or sets whether WeekNames will be displayed.

C#
public bool AreWeekNamesVisible { get; set; }
Remarks:

Please note that if you hide the WeekNames would not automatically change the template of the calendar. Depending on the skin, you may need to change the template to visually make up for the fewer displayed elements.

The AreWeekNumbersVisible can also be hidden.

The default value is true.

Gets or sets whether WeekNumbers will be displayed.

C#
public bool AreWeekNumbersVisible { get; set; }
Remarks:

Please note that if you hide the WeekNumbers it would not automatically change the template of the calendar. Depending on the skin, you may need to change the template to visually make up for the fewer displayed elements.

The AreWeekNamesVisible can also be hidden.

The default value is true.

Gets or sets a list of dates that cannot be selected. This is a dependency property.

C#
public IEnumerable<DateTime> BlackoutDates { get; set; }
Remarks:

The BlackoutDates specifies a list of dates that cannot be selected by the user.

Gets or sets how should the first week in the year be counted. This is a dependency property.

C#
public CalendarWeekRule? CalendarWeekRule { get; set; }
Remarks:

By default if no value is set (or is set to null), the CalendarWeek rule will be taken from Culture property (or InvariantCulture)'s DateTimeFormat.CalendarWeekRule.

Gets or sets the Clear Button style.

C#
public Style ClearButtonStyle { get; set; }

Gets or sets the culture that the Calendar uses. This is a dependency property.

C#
public CultureInfo Culture { get; set; }
Remarks:

Some of the elements in the Calendar are culture-specific, for example: The day/month names, rules for date formatting, the FirstDayOfWeek, CalendarWeekRule. Some more specific properties like FirstDayOfWeek take precedence over the Culture property if they are set.

If no Culture is specified, all the elements that rely on it will fall back to the CultureInfo.CurrentCulture.

The default value is null.

Gets or sets a value indicating the date pattern used in formatting the dates. Formats for abbreviated days (ddd,dddd), months (MMM, MMMM) are not supported. Hours, minutes, seconds, milliseconds are not supported.

C#
public string DatePattern { get; set; }

Gets or sets the Empty content.

C#
public object EmptyContent { get; set; }

Gets or sets the template of the EmptyContent.

C#
public DataTemplate EmptyContentTemplate { get; set; }

Gets or sets a value indicating the end date of the date range.

C#
public DateTime? EndDate { get; set; }

Gets or sets the day that is considered the beginning of the week.

C#
public DayOfWeek? FirstDayOfWeek { get; set; }

The FirstDayOfWeek property specifies which is the day in the leftmost column of the calendar view, i.e. which is the first day of the week.

If the property is set to null, the Culture will be checked, if a specific culture is set, its FirstDayOfWeek is considered. Otherwise the CurrentCulture will be used.

Generally, the start of the week varies with different cultures so if you would like the Calendar to display the dates as you see them, be sure to set the FirstDayOfWeek property or the Culture property.

<pre><code class="lang-csharp">calendar.FirstDayOfWeek = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;</code></pre>

Gets or sets the formatting string used to format the whole input text.

C#
public string FormatString { get; set; }

Gets or sets the visibility of the Calendar's header. This is a dependency property.

C#
public Visibility HeaderVisibility { get; set; }
Remarks:

The header of the calendar is the area on the top in which the Header Button and the Previous and NextButtons reside.

Gets or sets whether the clear button is visible.

C#
public bool IsClearButtonVisible { get; set; }

Gets or sets a value indicating whether the default ranges panel of the control is visible or not.

C#
public bool IsDefaultRangesPanelVisible { get; set; }

Gets or sets a value indicating whether the drop-down part of the control is open.

C#
public bool IsDropDownOpen { get; set; }

Gets or sets whether the control is IsReadOnly.

C#
public bool IsReadOnly { get; set; }

Gets or sets a value indicating whether the top bar of the control is visible or not.

C#
public bool IsTopBarVisible { get; set; }

Gets or sets the placeholder symbol marking an empty position in the input.

C#
[TypeConverter(typeof(CharConverter))]
public char Placeholder { get; set; }

Gets or sets the last date that can be selected. This is a dependency property.

C#
public DateTime? SelectableDateEnd { get; set; }
Remarks:

The SelectableDateEnd specifies the last date that can be selected by the user.

Gets or sets the first date that can be selected. This is a dependency property.

C#
public DateTime? SelectableDateStart { get; set; }
Remarks:

The SelectableDateStart specifies the first date that can be selected by the user.

Gets or sets a value indicating the behavior of the caret/selection when the control receives focus.

C#
public SelectionOnFocus SelectionOnFocus { get; set; }

Gets or sets the string representing the separator between the dates in the input.

C#
public string Separator { get; set; }

Gets or sets a value indicating the start date of the date range.

C#
public DateTime? StartDate { get; set; }

Methods

Gets the value of IsRangeEnd attached property for particular CalendarButton.

C#
public static bool GetIsRangeEnd(DependencyObject obj)
Parameters:objDependencyObjectReturns:

bool

Gets the value of IsRangeStart attached property for particular CalendarButton.

C#
public static bool GetIsRangeStart(DependencyObject obj)
Parameters:objDependencyObjectReturns:

bool

Called when user changes start/end day candidates and total selected days UI needs update.

C#
protected virtual string GetSelectedDaysRepresentation()
Returns:

string

Called when user has selected end day candidate and selection UI needs update.

C#
protected virtual string GetTemporaryEndDateRepresentation(DateTime? tempEndDay)
Parameters:tempEndDayDateTime?Returns:

string

Called when user has selected start day candidate and selection UI needs update.

C#
protected virtual string GetTemporaryStartDateRepresentation(DateTime? tempStartDay)
Parameters:tempStartDayDateTime?Returns:

string

Called when range is invalidated against blackout dates.

C#
protected virtual bool IsValidRange()
Returns:

bool

When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call .

C#
public override void OnApplyTemplate()

Returns class-specific System.Windows.Automation.Peers.AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

Raises the event. This method is invoked whenever is set to true internally.

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

The RoutedEventArgs that contains the event data.

C#
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters:eKeyEventArgs

Sets the value of IsRangeEnd attached property for particular CalendarButton.

C#
public static void SetIsRangeEnd(DependencyObject obj, bool value)
Parameters:objDependencyObjectvaluebool

Sets the value of IsRangeStart attached property for particular CalendarButton.

C#
public static void SetIsRangeStart(DependencyObject obj, bool value)
Parameters:objDependencyObjectvaluebool

Events

Occurs before custom ranges are loaded, so that user can reset them according to the current DateTime.

C#
public event EventHandler<CustomRangesLoadingEventArgs> CustomRangesLoading