RadDatePicker
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[EmbeddedSkin("DatePicker", typeof(RadDatePicker))]
[EmbeddedSkin("DatePicker", "Default", typeof(RadDatePicker))]
[ToolboxBitmap(typeof(RadDatePicker), "Toolbox.Icons.DatePicker.png")]
[TelerikToolboxCategory("Date/Color Picker")]
[ValidationProperty("ValidationDate")]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadDatePicker))]
[ControlValueProperty("SelectedDate")]
[ClientScriptResource("Telerik.Web.UI.RadDatePicker", "Telerik.Web.UI.Calendar.RadDatePicker.js")]
[ClientScriptResource("Telerik.Web.UI.RadDatePicker", "Telerik.Web.UI.Calendar.RadPickersPopupDirectionEnumeration.js")]
[ClientScriptResource("Telerik.Web.UI.RadDatePicker", "Telerik.Web.UI.Common.Navigation.OverlayScript.js")]
[RequiredScript(typeof(jQuery))]
[RequiredScript(typeof(MaterialRipple))]
public class RadDatePicker : RadWebControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, ISkinnableControl, IControl, INamingContainer, IPostBackEventHandler, IPostBackDataHandler
Inheritance: objectControlWebControlRadWebControlRadDatePicker
Derived Classes:
Implements:
Inherited Members
Constructors
public RadDatePicker()
Fields
protected Unit defaultWidth
Properties
Gets or sets a value indicating whether a postback to the server automatically occurs when the user interacts with the control.
public virtual bool AutoPostBack { get; set; }
The default value is false.
Setting this property to true will make RadDatePicker postback to the server on date selection through the Calendar or the DateInput components.
protected HttpBrowserCapabilities Browser { get; }
Gets the RadCalendar instance of the datepicker control.
[Browsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual RadCalendar Calendar { get; }
Gets or sets an instance of DatePickerClientEvents class which defines the JavaScript functions (client-side event handlers) that are invoked when specific client-side events are raised.
[PersistenceMode(PersistenceMode.InnerProperty)]
public DatePickerClientEvents ClientEvents { get; }
The CssClass property will now be used instead of the former Skin and will be modified in AddAttributesToRender()
protected override string CssClassFormatString { get; }
Overrides:
Gets or sets the culture used by RadDatePicker to format the date.
public virtual CultureInfo Culture { get; set; }
A CultureInfo object that represents the current culture used. The default value is System.Threading.Thread.CurrentThread.CurrentUICulture.
Gets the RadDateInput instance of the datepicker control.
[Browsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual RadDateInput DateInput { get; }
Gets the DatePopupButton instance of the datepicker control. You can use the object to customize the popup button's appearance and behavior.
[Browsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual CalendarPopupButton DatePopupButton { get; }
Gets or sets the date content of RadDatePicker in a database friendly way.
[Browsable(false)]
[TypeConverter(typeof(DateTimeConverter))]
[Bindable(true, BindingDirection.TwoWay)]
public virtual object DbSelectedDate { get; set; }
A DateTime object that represents the selected date. The default value is null (Nothing in VB).
This property behaves exactly like the SelectedDate property. The only difference is that it will not throw an exception if the new value is null or DBNull. Setting a null value will internally revert the SelectedDate to the null value, i.e. the input value will be empty.
When set to true enables support for WAI-ARIA
public bool EnableAriaSupport { get; set; }
Gets or sets a value indicating whether the Web server control is enabled.
public override bool Enabled { get; set; }
true if control is enabled; otherwise, false. The default is true.
Overrides:
Gets or sets the value, indicating whether to render the link to the embedded base stylesheet of the control or not.
public override bool EnableEmbeddedBaseStylesheet { get; set; }
Overrides:
If EnableEmbeddedBaseStylesheet is set to false you will have to register the needed control base CSS file by hand.
Gets or sets the value, indicating whether to render script references to the embedded scripts or not.
public override bool EnableEmbeddedScripts { get; set; }
Overrides:
If EnableEmbeddedScripts is set to false you will have to register the needed Scripts files by hand.
Gets or sets the value, indicating whether to render links to the embedded skins or not.
public override bool EnableEmbeddedSkins { get; set; }
Overrides:
If EnableEmbeddedSkins is set to false you will have to register the needed CSS files by hand.
Gets or sets the enable client side navigation with keyboard.
public virtual bool EnableKeyboardNavigation { get; set; }
The enable client side navigation with keyboard.
Gets or sets whether the screen boundaries should be taken into consideration when the Calendar or TimeView are displayed.
[ClientControlProperty]
[ClientPropertyName("_enableScreenBoundaryDetection")]
public bool EnableScreenBoundaryDetection { get; set; }
Gets or sets whether popup shadows will appear.
[ClientControlProperty]
[ClientPropertyName("_enableShadows")]
public bool EnableShadows { get; set; }
Enables or disables typing in the date input box.
public bool EnableTyping { get; set; }
true if the user should be able to select a date by typing in the date input box; otherwise false. The default value is true.
Gets or sets the date that the Calendar uses for focusing itself whenever the RadDateInput component of the RadDatePicker is empty.
[ClientControlProperty]
public DateTime FocusedDate { get; set; }
Gets or sets the title attribute for the hidden field.
public virtual string HiddenInputTitleAttibute { get; set; }
The default value is "Visually hidden input created for functionality purposes.".
Gets the settings associated with hiding the RadDatePicker its popup controls.
[PersistenceMode(PersistenceMode.InnerProperty)]
public CalendarAnimationSettings HideAnimation { get; }
The settings associated with hiding the RadDatePicker its popup controls.
Gets or sets default path for the grid images when EnableEmbeddedSkins is set to false.
public virtual string ImagesPath { get; set; }
A string containing the path for the grid images. The default is string.Empty.
Gets the invalid date string in the control's textbox
[Browsable(false)]
public string InvalidTextBoxValue { get; }
Used to determine if RadDatePicker is empty.
[Browsable(false)]
public bool IsEmpty { get; }
true if the date is empty; otherwise false.
Gets or sets a value indicating where RadDatePicker will look for its .resx localization file. By default this file should be in the App_GlobalResources folder. However, if you cannot put the resource file in the default location or .resx files compilation is disabled for some reason (e.g. in a DotNetNuke environment), this property should be set to the location of the resource file.
public string LocalizationPath { get; set; }
A relative path to the dialogs location. For example: "~/controls/RadDatePickerResources/".
If specified, the LocalizationPath property will allow you to load the grid localization file from any location in the web application.
Gets or sets the latest valid date for selection. Selecting a date later than that will not be allowed.
[ClientControlProperty]
public DateTime MaxDate { get; set; }
This property has a default value of 12/31/2099
Gets or sets the minimal range date for selection. Selecting a date earlier than that will not be allowed.
[ClientControlProperty]
public DateTime MinDate { get; set; }
This property has a default value of 1/1/1980
Gets or sets a value indicating whether the picker will create an overlay element to ensure popups are over a flash element or Java applet.
[Browsable(true)]
[Bindable(true)]
public bool Overlay { get; set; }
The default value is false.
Gets or sets the direction in which the popup Calendar is displayed, with relation to the DatePicker control.
[ClientControlProperty]
[ClientPropertyName("_popupDirection")]
public DatePickerPopupDirection PopupDirection { get; set; }
Gets or sets the value, indicating whether to register with the ScriptManager control on the page.
public override bool RegisterWithScriptManager { get; set; }
Overrides:
If RegisterWithScriptManager is set to false the control can be rendered on the page using Web Services or normal callback requests/page methods.
Sets the render mode of the RadDatePicker and its child controls
public override RenderMode RenderMode { get; set; }
Overrides:
Gets or sets the reference to the calendar that will be used for picking dates. This property allows you to configure several datepickers to use a single RadCalendar instance.
[Browsable(false)]
public RadCalendar SharedCalendar { get; set; }
The RadCalendar instance if set; otherwise null;
This property is not accessible from the VS.NET designer and you will have to set it from the code-behind. It should be used when the shared calendar instance is in another naming container or is created dynamically at runtime.
Gets or sets the ID of the calendar that will be used for picking dates. This property allows you to configure several datepickers to use a single RadCalendar instance.
[TypeConverter("Telerik.Web.Design.CalendarIdConverter")]
public virtual string SharedCalendarID { get; set; }
The string ID of the RadCalendar control if set; otherwise String.Empty.
RadDatePicker will look for the RadCalendar instance in a way similar to how ASP.NET validators work. It will not go beyond the current naming container which means that you will not be able to configure a calendar that is inside a control in another naming container. You can still share a calendar, but you will have to pass a direct object reference via the SharedCalendar property.
protected virtual bool ShouldRenderAdditionalControls { get; }
Gets the settings associated with showing the RadDatePicker its popup controls.
[PersistenceMode(PersistenceMode.InnerProperty)]
public CalendarAnimationSettings ShowAnimation { get; }
The settings associated with showing the RadDatePicker its popup controls.
Gets or sets whether the popup control (Calendar or TimeView) is displayed when the DateInput textbox is focused.
[ClientControlProperty]
[ClientPropertyName("_showPopupOnFocus")]
public bool ShowPopupOnFocus { get; set; }
The default value is false.
Gets or sets the skin name for the control user interface.
public override string Skin { get; set; }
A string containing the skin name for the control user interface. The default is string.Empty.
Overrides:
If this property is not set, the control will render using the skin named "Default". If EnableEmbeddedSkins is set to false, the control will not render skin.
Gets or sets if the server-side min/max date validation.
public bool SkipMinMaxDateValidationOnServer { get; set; }
Determines if the server-side min/max date validation.
public virtual string SmartPasteDescription { get; set; }
protected override bool SupportsRenderingMode { get; }
Overrides:
Gets or sets the tab index of the Web server control.
public override short TabIndex { get; set; }
The tab index of the Web server control. The default is 0, which indicates that this property is not set.
Exceptions: ArgumentOutOfRangeExceptionThe specified tab index is not between -32768 and 32767.
Overrides:
protected override HtmlTextWriterTag TagKey { get; }
Overrides:
This property is used by the RadDateInput's internals only. It is subject to change in the future versions. Please do not use.
[Browsable(false)]
public virtual string ValidationDate { get; }
Gets or sets the width of the datepicker in pixels.
public override Unit Width { get; set; }
Overrides:
Gets or sets the caption for the table which wraps the RadDatePicker controls.
public virtual string WrapperTableCaption { get; set; }
The default value is "RadDatePicker".
Setting this property to empty string will force Telerik RadDatePicker to not render caption tag.
Gets or sets summary attribute for the table which wraps the RadDatePicker controls.
public virtual string WrapperTableSummary { get; set; }
The default value is "Table holding date picker control for selection of dates.".
Setting this property to empty string will force Telerik RadDatePicker to not render summary tag.
Methods
protected virtual void AddAdditionalControlComponents(HtmlTextWriter writer)
protected override void AddAttributesToRender(HtmlTextWriter writer)
Overrides:
protected virtual void AddControlComponents(HtmlTextWriter writer)
Clears the selected date of the RadDatePicker control and displays a blank date.
public virtual void Clear()
Override this method to provide any last minute configuration changes. Make sure you call the base implementation.
public virtual void ConfigureCalendar()
Override this method to provide any last minute configuration changes. Make sure you call the base implementation.
public virtual void ConfigureDateInput()
Code moved into this method from OnPreRender to make sure it executed when the framework skips OnPreRender() for some reason
protected override void ControlPreRender()
Overrides:
protected override void CreateChildControls()
Overrides:
protected virtual void CreateTimeControls()
protected override void DescribeClientEvents(IScriptDescriptor descriptor)
Overrides:
protected override void DescribeClientProperties(IScriptDescriptor descriptor)
Overrides:
protected override void DescribeComponent(IScriptDescriptor descriptor)
Overrides:
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
protected virtual void DescribeProperties(IScriptDescriptor descriptor)
Sets input focus to a control.
public override void Focus()
Overrides:
Loads the client state data
protected override void LoadClientState(Dictionary<string, object> clientState)
Overrides:
protected virtual void OnChildrenCreated()
protected virtual void OnSelectedDateChanged(SelectedDateChangedEventArgs eventArgs)
Registers the CSS references
protected override void RegisterCssReferences()
Overrides:
protected void RenderBrowserSpecificStyles(HtmlTextWriter writer)
protected override void RenderChildren(HtmlTextWriter writer)
Overrides:
protected override void RenderContents(HtmlTextWriter writer)
Overrides:
protected virtual void SetDefaultSize()
Events
Occurs after all child controls of the DatePicker control have been created. You can customize the control there, and add additional child controls.
public event EventHandler ChildrenCreated
Occurs when the selected date of the DatePicker changes between posts to the server.
public event SelectedDateChangedEventHandler SelectedDateChanged