$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
How to Put up MonthYearPicker Using C#
Home > How to > Calendar MonthYearPicker

As demonstrated in the MonthYearPicker for ASP.NET AJAX tutorial page, a number of properties can let you set up and specify a MonthYear picker. And this page aims at providing related demo C# codes to set and customize these MonthYearPicker properties in the asp.net calendar control.

How to Use C# Codes to Set DatePopupButton

By clicking the DatePopupButton in the right corner we can set the basic properties of MonthYearPicker, such as its Visible, ImageUrl, Border, ToolTip, BackColor and any other related attribute.

PerMonthYearPicker1.DatePopupButton.Visible = true;
PerMonthYearPicker1.DatePopupButton.Enabled = true;
PerMonthYearPicker1.DatePopupButton.BorderColor = System.Drawing.Color.AliceBlue;
PerMonthYearPicker1.DatePopupButton.BorderWidth = 3;

How to Use C# Codes to Set MonthYearPicker properties


PerMonthYearPicker1.MinDate = newDateTime(2000, 1, 1);
PerMonthYearPicker1.MaxDate = newDateTime(3000, 1, 1);
PerMonthYearPicker1.Culture = newCultureInfo("English");
PerMonthYearPicker1.PopupDirection = DatePickerPopupDirection.BottomRight;
Use these demo C# codes to set following MonthYearPicker properties respectively:
  • MaxDate/MinDate: the maximum and minimum date that can be set with the support of Datetimepicker.
  • Culture: if we apply and change this property, the compliant text of monthyearpicker will be change at the same time.
  • PopupDirection: we can freely move monthyearpicker to these four directions: TopLeft, TopRight , BottomLeft and BottomRight with the support of this property.

How to Use C# Codes to Set MonthYearTableViewer

If you are the first-time user for MonthYearPicker, please read following MonthYearTableViewer properties and together with their sample codes.
  • CancelButtonCaption: is designed to set the text of CancleBotton.
  • OkButtonCaption: is used to set the text of OkButton.
  • TodayButtonCaption: is used to set the text of TodayButton.
  • NavigationNextImage/NavigationPrevImage: the displaying image when page up and page down.
  • NavigationNextText/NavigationPrevText: the displaying text when page up and page down.
  • NavigationNextToolTip/NavigationPrevToolTip: the displaying tooltip when page up and page down.

PerMonthYearPicker1.MonthYearNavigationSettings.NavigationNextText = "Next";
PerMonthYearPicker1.MonthYearNavigationSettings.NavigationNextToolTip = "Next View";
PerMonthYearPicker1.MonthYearNavigationSettings.NavigationPrevText = "Prev";
PerMonthYearPicker1.MonthYearNavigationSettings.NavigationPrevToolTip = "Previous View";

How to Use C# Codes to Set DateInput


PerMonthYearPicker1.DateInput.DateFormat = "MMMM/yyyy";
PerMonthYearPicker1.DateInput.DisplayDateFormat = "MMMM/yyyy";
Two properties' explanations are listed below:
  • DateFormat: use this property to set the format of input time of time viewer.
  • DisplayDateFormat: is used to display the time format.

How to Use C# Codes to Set Animation

When we invoke the animation property, there are two compatible animation types: ShowAnimation and HideAnimation and if we choose ShowAnimation, there will be animation appending when the calendar popups and closes.

PerMonthYearPicker1.ShowAnimation.Duration = 300;
PerMonthYearPicker1.ShowAnimation.Type = CalendarAnimationType.Fade;

More Related Guides

ASP.NET AJAX UI Controls