New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

RadMonthYearPicker class

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[EmbeddedSkin("Calendar", typeof(RadCalendar))]
[EmbeddedSkin("Calendar", "Default", typeof(RadCalendar))]
[ToolboxBitmap(typeof(RadDatePicker), "Toolbox.Icons.MonthyearPicker.png")]
[TelerikToolboxCategory("Date/Color Picker")]
[ValidationProperty("ValidationDate")]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadMonthYearPicker))]
[ControlValueProperty("SelectedDate")]
[ClientScriptResource("Telerik.Web.UI.RadMonthYearPicker", "Telerik.Web.UI.Calendar.RadCalendarScript.js")]
[ClientScriptResource("Telerik.Web.UI.RadMonthYearPicker", "Telerik.Web.UI.Calendar.RadCalendarCommonScript.js")]
[ClientScriptResource("Telerik.Web.UI.RadMonthYearPicker", "Telerik.Web.UI.Calendar.RadMonthYearPickerScript.js")]
[ClientScriptResource("Telerik.Web.UI.RadMonthYearPicker", "Telerik.Web.UI.Calendar.RadPickersPopupDirectionEnumeration.js")]
[ClientScriptResource("Telerik.Web.UI.RadMonthYearPicker", "Telerik.Web.UI.Common.Navigation.OverlayScript.js")]
[RequiredScript(typeof(jQuery))]
[RequiredScript(typeof(MaterialRipple))]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadMonthYearPicker))]
public class RadMonthYearPicker : PropertiesControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, ISkinnableControl, IControl, IStateManager, INamingContainer, IPostBackEventHandler, IPostBackDataHandler

Inheritance: objectControlWebControlRadWebControlPropertiesControlRadMonthYearPicker...

Implements: IAttributeAccessorIComponentIControlIControlBuilderAccessorIControlDesignerAccessorIControlResolverIDataBindingsAccessorIDisposableIExpressionsAccessorINamingContainerIParserAccessorIPostBackDataHandlerIPostBackEventHandlerIScriptControlISkinnableControlIStateManagerIUrlResolutionService...

Inherited Members PropertiesControl.LoadViewState(object)PropertiesControl.SaveViewState()PropertiesControl.TrackViewState()WebControl.ApplyStyle(Style)WebControl.CopyBaseAttributes(WebControl)WebControl.CreateControlStyle()WebControl.MergeStyle(Style)WebControl.RenderBeginTag(HtmlTextWriter)WebControl.RenderEndTag(HtmlTextWriter)WebControl.AccessKeyWebControl.AttributesWebControl.BackColorWebControl.BorderColorWebControl.BorderWidthWebControl.BorderStyleWebControl.ControlStyleWebControl.ControlStyleCreatedWebControl.CssClassWebControl.DisabledCssClassWebControl.StyleWebControl.EnableThemingWebControl.FontWebControl.ForeColorWebControl.HasAttributesWebControl.HeightWebControl.IsEnabledWebControl.SupportsDisabledAttributeWebControl.SkinIDWebControl.TagNameWebControl.ToolTipControl.ResolveAdapter()Control.HasEvents()Control.GetRouteUrl(object)Control.GetRouteUrl(string, object)Control.GetRouteUrl(RouteValueDictionary)Control.GetRouteUrl(string, RouteValueDictionary)Control.GetUniqueIDRelativeTo(Control)Control.ApplyStyleSheetSkin(Page)Control.OnDataBinding(EventArgs)Control.DataBind()Control.DataBind(bool)Control.DataBindChildren()Control.AddParsedSubObject(object)Control.EnsureID()Control.ClearChildState()Control.ClearChildControlState()Control.ClearChildViewState()Control.ClearEffectiveClientIDMode()Control.ClearCachedClientID()Control.LoadControlState(object)Control.MapPathSecure(string)Control.OpenFile(string)Control.OnPreRender(EventArgs)Control.BuildProfileTree(string, bool)Control.SaveControlState()Control.RenderControl(HtmlTextWriter)Control.RenderControl(HtmlTextWriter, ControlAdapter)Control.OnUnload(EventArgs)Control.Dispose()Control.RaiseBubbleEvent(object, EventArgs)Control.OnBubbleEvent(object, EventArgs)Control.AddedControl(Control, int)Control.CreateControlCollection()Control.ResolveUrl(string)Control.ResolveClientUrl(string)Control.FindControl(string)Control.FindControl(string, int)Control.GetDesignModeState()Control.HasControls()Control.IsLiteralContent()Control.EnsureChildControls()Control.RemovedControl(Control)Control.SetDesignModeState(IDictionary)Control.SetRenderMethodDelegate(RenderMethod)Control.ClientIDModeControl.ClientIDControl.ClientIDSeparatorControl.ContextControl.AdapterControl.DesignModeControl.EventsControl.IDControl.IsChildControlStateClearedControl.EnableViewStateControl.ViewStateModeControl.IsViewStateEnabledControl.NamingContainerControl.IdSeparatorControl.LoadViewStateByIDControl.PageControl.RenderingCompatibilityControl.TemplateControlControl.ParentControl.TemplateSourceDirectoryControl.AppRelativeTemplateSourceDirectoryControl.SiteControl.VisibleControl.UniqueIDControl.HasChildViewStateControl.ControlsControl.ValidateRequestModeControl.ViewStateControl.ViewStateIgnoresCaseControl.ChildControlsCreatedControl.IsTrackingViewStateControl.DisposedControl.DataBindingControl.InitControl.LoadControl.PreRenderControl.Unloadobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public RadMonthYearPicker()

Fields

C#
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.

C#
public virtual bool AutoPostBack { get; set; }
Property Value:

The default value is false.

Setting this property to true will make RadMonthYearPicker postback to the server on date selection through the MonthYearView or the DateInput components.

C#
protected HttpBrowserCapabilities Browser { get; }

Gets a set of properties that get or set the names of the JavaScript functions that are invoked upon specific client-side events.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public MonthYearPickerClientEvents ClientEvents { get; }
Property Value:

A set of properties that get or set the names of the JavaScript functions that are invoked upon specific client-side events.

The client-side id of the inner input element used for intergation with RadLabel

C#
public string ControlId { get; }

The CssClass property will now be used instead of the former Skin and will be modified in AddAttributesToRender()

C#
protected override string CssClassFormatString { get; }

Overrides: RadWebControl.CssClassFormatString

Example:
C#
protected override string CssClassFormatString
{
       get
       {
           return "RadDock RadDock_{0} rdWTitle rdWFooter";
       }
}

Gets or sets the culture used by RadMonthYearPicker to format the date.

C#
public virtual CultureInfo Culture { get; set; }
Property Value:

A CultureInfo object that represents the current culture used. The default value is System.Threading.Thread.CurrentThread.CurrentUICulture.

Example:
cs-api-definition
private void Page_Load(object sender, System.EventArgs e)
{
RadMonthYearPicker1.Culture = new CultureInfo("en-US");
}

Gets the RadDateInput instance of the RadMonthYearPicker control.

C#
[Browsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual RadDateInput DateInput { get; }

Gets the DatePopupButton instance of the RadMonthYearPicker control. You can use the object to customize the popup button's appearance and behavior.

C#
[Browsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual MonthYearPopupButton DatePopupButton { get; }

Gets or sets the date content of RadMonthYearPicker in a database friendly way.

C#
[Browsable(false)]
[TypeConverter(typeof(DateTimeConverter))]
[Bindable(true, BindingDirection.TwoWay)]
public object DbSelectedDate { get; set; }
Property Value:

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.

Example:
cs-api-definition
private void Page_Load(object sender, System.EventArgs e)
{
RadMonthYearPicker1.DbSelectedDate = tableRow["BirthDate"];
}
C#
protected bool EmptySkin { get; }

When set to true enables support for WAI-ARIA

C#
public bool EnableAriaSupport { get; set; }

Gets or sets a value indicating whether the Web server control is enabled.

C#
public override bool Enabled { get; set; }
Property Value:

true if control is enabled; otherwise, false. The default is true.

Overrides: RadWebControl.Enabled

Gets or sets the value, indicating whether to render the link to the embedded base stylesheet of the control or not.

C#
public override bool EnableEmbeddedBaseStylesheet { get; set; }

Overrides: RadWebControl.EnableEmbeddedBaseStylesheet

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.

C#
public override bool EnableEmbeddedScripts { get; set; }

Overrides: RadWebControl.EnableEmbeddedScripts

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.

C#
public override bool EnableEmbeddedSkins { get; set; }

Overrides: RadWebControl.EnableEmbeddedSkins

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.

C#
public bool EnableKeyboardNavigation { get; set; }
Property Value:

The enable client side navigation with keyboard.

Gets or sets whether popup shadows will appear.

C#
[ClientControlProperty]
[ClientPropertyName("_enableShadows")]
public bool EnableShadows { get; set; }

Enables or disables typing in the date input box.

C#
public bool EnableTyping { get; set; }
Property Value:

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 the style properties for the Month/Year fast navigation.

C#
[Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public TableItemStyle FastNavigationStyle { get; }
Property Value:

A TableItemStyle that contains the style properties for the the Month/Year fast navigation.

Gets or sets the MonthYearView uses this date to focus itself whenever the date input component of the RadMonthYearPicker is empty.

C#
[ClientControlProperty]
public DateTime FocusedDate { get; set; }
Property Value:

The MonthYearView uses this date to focus itself whenever the date input component of the RadMonthYearPicker is empty.

Gets or sets the title attribute for the hidden field.

C#
public virtual string HiddenInputTitleAttibute { get; set; }
Property Value:

The default value is "Title and navigation".

Gets the settings associated with hiding the RadMonthYearPicker its popup controls.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public CalendarAnimationSettings HideAnimation { get; }
Property Value:

The settings associated with hiding the RadMonthYearPicker its popup controls.

Gets or sets default path for the grid images when EnableEmbeddedSkins is set to false.

C#
public virtual string ImagesPath { get; set; }
Property Value:

A string containing the path for the grid images. The default is string.Empty.

Gets the invalid date string in the control's textbox

C#
[Browsable(false)]
public string InvalidTextBoxValue { get; }

Used to determine if RadMonthYearPicker is empty.

C#
[Browsable(false)]
public bool IsEmpty { get; }
Property Value:

true if the date is empty; otherwise false.

Gets or sets a value indicating where RadMonthYearPicker 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.

C#
public string LocalizationPath { get; set; }
Property Value:

A relative path to the dialogs location. For example: "~/controls/RadMonthYearPickerResources/".

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.

C#
[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.

C#
[ClientControlProperty]
public DateTime MinDate { get; set; }

This property has a default value of 1/1/1980

Gets the style applied to month cells.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual TableItemStyle MonthCellsStyle { get; }
Property Value:

The style applied to month cells.

Gets the subproperties can be used to modify the fast Month/Year navigation popup settings.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public MonthYearNavigationSettings MonthYearNavigationSettings { get; }
Property Value:

The subproperties can be used to modify the fast Month/Year navigation popup settings.

Gets the MonthYearView instance of the MonthYearPicker control.

C#
[Browsable(false)]
public virtual MonthYearView MonthYearTableView { get; }

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.

C#
[Browsable(true)]
[Bindable(true)]
public bool Overlay { get; set; }
Property Value:

The default value is false.

Gets or sets the direction in which the popup MonthYearView is displayed, with relation to the RadMonthYearPicker control.

C#
[ClientControlProperty]
[ClientPropertyName("_popupDirection")]
public DatePickerPopupDirection PopupDirection { get; set; }

Gets or sets the value, indicating whether to register with the ScriptManager control on the page.

C#
public override bool RegisterWithScriptManager { get; set; }

Overrides: RadWebControl.RegisterWithScriptManager

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

C#
public override RenderMode RenderMode { get; set; }

Overrides: RadWebControl.RenderMode

Gets or sets the date content of RadMonthYearPicker.

C#
public virtual DateTime? SelectedDate { get; set; }
Property Value:

A DateTime object that represents the selected date. The default value is MinDate.

Example:
cs-api-definition
private void Page_Load(object sender, System.EventArgs e)
{
RadMonthYearPicker1.SelectedDate = DateTime.Now;
}
C#
protected virtual bool ShouldRenderAdditionalControls { get; }

Gets the settings associated with showing the RadMonthYearPicker its popup controls.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public CalendarAnimationSettings ShowAnimation { get; }
Property Value:

The settings associated with showing the RadMonthYearPicker its popup controls.

Gets or sets whether the popup control is displayed when the DateInput textbox is focused.

C#
[ClientControlProperty]
[ClientPropertyName("_showPopupOnFocus")]
public bool ShowPopupOnFocus { get; set; }
Property Value:

The default value is false.

Gets or sets the skin name for the control user interface.

C#
public override string Skin { get; set; }
Property Value:

A string containing the skin name for the control user interface. The default is string.Empty.

Overrides: RadWebControl.Skin

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.

C#
protected override bool SupportsRenderingMode { get; }

Overrides: RadWebControl.SupportsRenderingMode

Gets or sets the tab index of the Web server control.

C#
public override short TabIndex { get; set; }
Property Value:

The tab index of the Web server control. The default is 0, which indicates that this property is not set.

Exceptions: ArgumentOutOfRangeException

The specified tab index is not between -32768 and 32767.

Overrides: RadWebControl.TabIndex

C#
protected override HtmlTextWriterTag TagKey { get; }

Overrides: WebControl.TagKey

This property is used by the RadDateInput's internals only. It is subject to change in the future versions. Please do not use.

C#
[Browsable(false)]
public virtual string ValidationDate { get; }

Gets or sets the width of the RadMonthYearPicker in pixels.

C#
public override Unit Width { get; set; }

Overrides: RadWebControl.Width

Gets or sets the caption for the table which wraps the RadMonthYearPicker controls.

C#
public virtual string WrapperTableCaption { get; set; }
Property Value:

The default value is "RadMonthYearPicker".

Setting this property to empty string will force Telerik RadMonthYearPicker to not render caption tag.

Gets or sets summary attribute for the table which wraps the RadMonthYearPicker controls.

C#
public virtual string WrapperTableSummary { get; set; }
Property Value:

The default value is "RadMonthYearPicker".

Setting this property to empty string will force Telerik RadMonthYearPicker to not render summary tag.

Gets the style applied to year cells.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual TableItemStyle YearCellsStyle { get; }
Property Value:

The style applied to year cells.

Gets or sets the z-index style of the control's popups

C#
[ClientControlProperty]
[ClientPropertyName("_zIndex")]
public int ZIndex { get; set; }

Methods

C#
protected virtual void AddAdditionalControlComponents(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter
C#
protected override void AddAttributesToRender(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadWebControl.AddAttributesToRender(HtmlTextWriter)

C#
protected virtual void AddControlComponents(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Clears the selected date of the RadMonthYearPicker control and displays a blank date.

C#
public virtual void Clear()

Override this method to provide any last minute configuration changes. Make sure you call the base implementation.

C#
public virtual void ConfigureDateInput()

Code moved into this method from OnPreRender to make sure it executed when the framework skips OnPreRender() for some reason

C#
protected override void ControlPreRender()

Overrides: RadWebControl.ControlPreRender()

C#
protected override void CreateChildControls()

Overrides: Control.CreateChildControls()

C#
protected override void DescribeComponent(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Overrides: RadWebControl.DescribeComponent(IScriptDescriptor)

C#
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
protected virtual void DescribeProperties(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Sets input focus to a control.

C#
public override void Focus()

Overrides: Control.Focus()

C#
protected string GetImage(string fileName)
Parameters:fileNamestringReturns:

string

C#
protected virtual bool IsOnlyInputRendered()
Returns:

bool

Loads the client state data

C#
protected override void LoadClientState(Dictionary<string, object> clientState)
Parameters:clientStateDictionary<string, object>

Overrides: RadWebControl.LoadClientState(Dictionary<string, object>)

Executed when post data is loaded from the request

C#
protected override bool LoadPostData(string postDataKey, NameValueCollection postCollection)
Parameters:postDataKeystringpostCollectionNameValueCollectionReturns:

bool

Overrides: RadWebControl.LoadPostData(string, NameValueCollection)

C#
protected virtual void OnChildrenCreated()
C#
protected override void OnInit(EventArgs e)
Parameters:eEventArgs

Overrides: RadWebControl.OnInit(EventArgs)

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

Overrides: Control.OnLoad(EventArgs)

C#
protected virtual void OnSelectedDateChanged(SelectedDateChangedEventArgs eventArgs)
Parameters:eventArgsSelectedDateChangedEventArgs
C#
protected virtual void OnViewCellCreated(MonthYearViewCellCreatedEventArgs eventArgs)
Parameters:eventArgsMonthYearViewCellCreatedEventArgs
C#
protected virtual DateTime? RangeSelectedDateProperty(DateTime? value)
Parameters:valueDateTime?Returns:

DateTime?

Registers the CSS references

C#
protected override void RegisterCssReferences()

Overrides: RadWebControl.RegisterCssReferences()

C#
protected override void Render(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadWebControl.Render(HtmlTextWriter)

C#
protected void RenderBrowserSpecificStyles(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter
C#
protected override void RenderChildren(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: Control.RenderChildren(HtmlTextWriter)

C#
protected override void RenderContents(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadWebControl.RenderContents(HtmlTextWriter)

C#
protected virtual void SetDefaultSize()
C#
protected virtual void SetRenderMode(RenderMode mode)
Parameters:modeRenderMode
C#
protected virtual DateTime TruncateTimeComponent(DateTime value)
Parameters:valueDateTimeReturns:

DateTime

Events

Occurs after all child controls of the RadMonthYearPicker control have been created. You can customize the control there, and add additional child controls.

C#
public event EventHandler ChildrenCreated

Occurs when the selected date of the RadMonthYearPicker changes between posts to the server.

C#
public event SelectedDateChangedEventHandler SelectedDateChanged
C#
public event MonthYearViewCellCreatedEventHandler ViewCellCreated
In this article
DefinitionConstructorsRadMonthYearPicker()FieldsdefaultWidthPropertiesAutoPostBackBrowserClientEventsControlIdCssClassFormatStringCultureDateInputDatePopupButtonDbSelectedDateEmptySkinEnableAriaSupportEnabledEnableEmbeddedBaseStylesheetEnableEmbeddedScriptsEnableEmbeddedSkinsEnableKeyboardNavigationEnableShadowsEnableTypingFastNavigationStyleFocusedDateHiddenInputTitleAttibuteHideAnimationImagesPathInvalidTextBoxValueIsEmptyLocalizationPathMaxDateMinDateMonthCellsStyleMonthYearNavigationSettingsMonthYearTableViewOverlayPopupDirectionRegisterWithScriptManagerRenderModeSelectedDateShouldRenderAdditionalControlsShowAnimationShowPopupOnFocusSkinSupportsRenderingModeTabIndexTagKeyValidationDateWidthWrapperTableCaptionWrapperTableSummaryYearCellsStyleZIndexMethodsAddAdditionalControlComponents(HtmlTextWriter)AddAttributesToRender(HtmlTextWriter)AddControlComponents(HtmlTextWriter)Clear()ConfigureDateInput()ControlPreRender()CreateChildControls()DescribeComponent(IScriptDescriptor)DescribeProperties(IScriptDescriptor)Focus()GetImage(string)IsOnlyInputRendered()LoadClientState(Dictionary<string, object>)LoadPostData(string, NameValueCollection)OnChildrenCreated()OnInit(EventArgs)OnLoad(EventArgs)OnSelectedDateChanged(SelectedDateChangedEventArgs)OnViewCellCreated(MonthYearViewCellCreatedEventArgs)RangeSelectedDateProperty(DateTime?)RegisterCssReferences()Render(HtmlTextWriter)RenderBrowserSpecificStyles(HtmlTextWriter)RenderChildren(HtmlTextWriter)RenderContents(HtmlTextWriter)SetDefaultSize()SetRenderMode(RenderMode)TruncateTimeComponent(DateTime)EventsChildrenCreatedSelectedDateChangedViewCellCreated
Not finding the help you need?
Contact Support