Class
RadDateRangePicker

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

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.Input.dll

Syntax:

cs-api-definition
[Themable]
[TelerikToolboxCategory("Input")]
public class RadDateRangePicker : Control

Inheritance: objectRadDateRangePicker

Constructors

RadDateRangePicker()

Initializes a new instance of the RadDateRangePicker class.

Declaration

cs-api-definition
public RadDateRangePicker()

Fields

AreWeekNamesVisibleProperty

Identifies the dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty AreWeekNamesVisibleProperty

Field Value

DependencyProperty

AreWeekNumbersVisibleProperty

Identifies the dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty AreWeekNumbersVisibleProperty

Field Value

DependencyProperty

BlackoutDatesProperty

Identifies the dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty BlackoutDatesProperty

Field Value

DependencyProperty

CalendarWeekRuleProperty

Identifies the dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CalendarWeekRuleProperty

Field Value

DependencyProperty

ClearButtonStyleProperty

Identifies the ClearButtonStyle dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ClearButtonStyleProperty

Field Value

DependencyProperty

CultureProperty

Identifies the dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CultureProperty

Field Value

DependencyProperty

DatePatternProperty

Identifies the DatePattern dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DatePatternProperty

Field Value

DependencyProperty

EmptyContentProperty

Identifies the EmptyContent dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty EmptyContentProperty

Field Value

DependencyProperty

EmptyContentTemplateProperty

Identifies the EmptyContentTemplate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty EmptyContentTemplateProperty

Field Value

DependencyProperty

EndDateProperty

Identifies EndDate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty EndDateProperty

Field Value

DependencyProperty

FirstDayOfWeekProperty

Identifies the dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty FirstDayOfWeekProperty

Field Value

DependencyProperty

FormatStringProperty

Identifies the FormatString dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty FormatStringProperty

Field Value

DependencyProperty

HeaderVisibilityProperty

Identifies the dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty HeaderVisibilityProperty

Field Value

DependencyProperty

IsClearButtonVisibleProperty

Identifies the IsClearButtonVisible dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsClearButtonVisibleProperty

Field Value

DependencyProperty

IsDefaultRangesPanelVisibleProperty

Identifies the IsDefaultRangesPanelVisible dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsDefaultRangesPanelVisibleProperty

Field Value

DependencyProperty

IsDropDownOpenProperty

Identifies the IsDropDownOpen dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsDropDownOpenProperty

Field Value

DependencyProperty

IsRangeEndProperty

Identifies IsRangeEnd attached property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsRangeEndProperty

Field Value

DependencyProperty

IsRangeStartProperty

Identifies IsRangeStart attached property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsRangeStartProperty

Field Value

DependencyProperty

IsReadOnlyProperty

Identifies the IsReadOnly dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsReadOnlyProperty

Field Value

DependencyProperty

IsTopBarVisibleProperty

Identifies the IsTopBarVisible dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsTopBarVisibleProperty

Field Value

DependencyProperty

PlaceholderProperty

Identifies the Placeholder dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty PlaceholderProperty

Field Value

DependencyProperty

SelectableDateEndProperty

Identifies the dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectableDateEndProperty

Field Value

DependencyProperty

SelectableDateStartProperty

Identifies the dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectableDateStartProperty

Field Value

DependencyProperty

SelectionOnFocusProperty

Identifies the SelectionOnFocus dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectionOnFocusProperty

Field Value

DependencyProperty

SeparatorProperty

Identifies the Separator dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SeparatorProperty

Field Value

DependencyProperty

StartDateProperty

Identifies StartDate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty StartDateProperty

Field Value

DependencyProperty

UseShortestDayNamesProperty

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

Declaration

cs-api-definition
public static readonly DependencyProperty UseShortestDayNamesProperty

Field Value

DependencyProperty

Properties

AreWeekNamesVisible

Gets or sets whether WeekNames will be displayed.

Declaration

cs-api-definition
public bool AreWeekNamesVisible { get; set; }

Property Value

bool

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.

AreWeekNumbersVisible

Gets or sets whether WeekNumbers will be displayed.

Declaration

cs-api-definition
public bool AreWeekNumbersVisible { get; set; }

Property Value

bool

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.

BlackoutDates

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

Declaration

cs-api-definition
public IEnumerable<DateTime> BlackoutDates { get; set; }

Property Value

IEnumerable<DateTime>

Remarks

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

CalendarWeekRule

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

Declaration

cs-api-definition
public CalendarWeekRule? CalendarWeekRule { get; set; }

Property Value

CalendarWeekRule?

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.

ClearButtonStyle

Gets or sets the Clear Button style.

Declaration

cs-api-definition
public Style ClearButtonStyle { get; set; }

Property Value

Style

Culture

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

Declaration

cs-api-definition
public CultureInfo Culture { get; set; }

Property Value

CultureInfo

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.

DatePattern

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.

Declaration

cs-api-definition
public string DatePattern { get; set; }

Property Value

string

EmptyContent

Gets or sets the Empty content.

Declaration

cs-api-definition
public object EmptyContent { get; set; }

Property Value

object

EmptyContentTemplate

Gets or sets the template of the EmptyContent.

Declaration

cs-api-definition
public DataTemplate EmptyContentTemplate { get; set; }

Property Value

DataTemplate

EndDate

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

Declaration

cs-api-definition
public DateTime? EndDate { get; set; }

Property Value

DateTime?

FirstDayOfWeek

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

Declaration

cs-api-definition
public DayOfWeek? FirstDayOfWeek { get; set; }

Property Value

DayOfWeek?

Remarks

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.

calendar.FirstDayOfWeek = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;

FormatString

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

Declaration

cs-api-definition
public string FormatString { get; set; }

Property Value

string

HeaderVisibility

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

Declaration

cs-api-definition
public Visibility HeaderVisibility { get; set; }

Property Value

Visibility

Remarks

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

IsClearButtonVisible

Gets or sets whether the clear button is visible.

Declaration

cs-api-definition
public bool IsClearButtonVisible { get; set; }

Property Value

bool

IsDefaultRangesPanelVisible

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

Declaration

cs-api-definition
public bool IsDefaultRangesPanelVisible { get; set; }

Property Value

bool

IsDropDownOpen

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

Declaration

cs-api-definition
public bool IsDropDownOpen { get; set; }

Property Value

bool

IsReadOnly

Gets or sets whether the control is IsReadOnly.

Declaration

cs-api-definition
public bool IsReadOnly { get; set; }

Property Value

bool

IsTopBarVisible

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

Declaration

cs-api-definition
public bool IsTopBarVisible { get; set; }

Property Value

bool

Placeholder

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

Declaration

cs-api-definition
[TypeConverter(typeof(CharConverter))]
public char Placeholder { get; set; }

Property Value

char

SelectableDateEnd

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

Declaration

cs-api-definition
public DateTime? SelectableDateEnd { get; set; }

Property Value

DateTime?

Remarks

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

SelectableDateStart

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

Declaration

cs-api-definition
public DateTime? SelectableDateStart { get; set; }

Property Value

DateTime?

Remarks

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

SelectionOnFocus

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

Declaration

cs-api-definition
public SelectionOnFocus SelectionOnFocus { get; set; }

Property Value

SelectionOnFocus

Separator

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

Declaration

cs-api-definition
public string Separator { get; set; }

Property Value

string

StartDate

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

Declaration

cs-api-definition
public DateTime? StartDate { get; set; }

Property Value

DateTime?

Methods

GetIsRangeEnd(DependencyObject)

Gets the value of IsRangeEnd attached property for particular CalendarButton.

Declaration

cs-api-definition
public static bool GetIsRangeEnd(DependencyObject obj)

Parameters

obj

DependencyObject

Returns

bool

GetIsRangeStart(DependencyObject)

Gets the value of IsRangeStart attached property for particular CalendarButton.

Declaration

cs-api-definition
public static bool GetIsRangeStart(DependencyObject obj)

Parameters

obj

DependencyObject

Returns

bool

GetSelectedDaysRepresentation()

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

Declaration

cs-api-definition
protected virtual string GetSelectedDaysRepresentation()

Returns

string

GetTemporaryEndDateRepresentation(DateTime?)

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

Declaration

cs-api-definition
protected virtual string GetTemporaryEndDateRepresentation(DateTime? tempEndDay)

Parameters

tempEndDay

DateTime?

Returns

string

GetTemporaryStartDateRepresentation(DateTime?)

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

Declaration

cs-api-definition
protected virtual string GetTemporaryStartDateRepresentation(DateTime? tempStartDay)

Parameters

tempStartDay

DateTime?

Returns

string

IsValidRange()

Called when range is invalidated against blackout dates.

Declaration

cs-api-definition
protected virtual bool IsValidRange()

Returns

bool

OnApplyTemplate()

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

Declaration

cs-api-definition
public override void OnApplyTemplate()

OnCreateAutomationPeer()

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

Declaration

cs-api-definition
protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

OnInitialized(EventArgs)

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

Declaration

cs-api-definition
protected override void OnInitialized(EventArgs e)

Parameters

e

EventArgs

The RoutedEventArgs that contains the event data.

OnPreviewKeyDown(KeyEventArgs)

Declaration

cs-api-definition
protected override void OnPreviewKeyDown(KeyEventArgs e)

Parameters

e

KeyEventArgs

SetIsRangeEnd(DependencyObject, bool)

Sets the value of IsRangeEnd attached property for particular CalendarButton.

Declaration

cs-api-definition
public static void SetIsRangeEnd(DependencyObject obj, bool value)

Parameters

obj

DependencyObject

value

bool

SetIsRangeStart(DependencyObject, bool)

Sets the value of IsRangeStart attached property for particular CalendarButton.

Declaration

cs-api-definition
public static void SetIsRangeStart(DependencyObject obj, bool value)

Parameters

obj

DependencyObject

value

bool

Events

CustomRangesLoading

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

Declaration

cs-api-definition
public event EventHandler<CustomRangesLoadingEventArgs> CustomRangesLoading

Event Value

EventHandler<CustomRangesLoadingEventArgs>