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

Kettic Calender UI for ASP.NET AJAX library is designed to provide users the complete calendar composite objects: they are ASP.NET AJAX Calender tool, ASP.NET AJAX DatePicker control, ASP.NET AJAX TimePicker component as well as ASP.NET AJAX DateTime Picker object. And all of these embedded calendar components are customizable.

C# Demo Codes for Setting up Datepicker

In this part, users can get well informed of setting up and defining Datepicker within C#.NET project by using Kettic Calender UI for ASP.NET AJAX components.

How to set DatePopupButton Using C#

Following sample C# codes are for setting the properties collection of DatePopupButton, such as, Visible, Border, ToolTip, BorderColor, and BorderWidth.

PerDatePicker1.DatePopupButton.Visible = true;
PerDatePicker1.DatePopupButton.Enabled = true;
PerDatePicker1.DatePopupButton.BorderColor = System.Drawing.Color.Beige;
PerDatePicker1.DatePopupButton.BorderWidth = 3;
PerDatePicker1.DatePopupButton.ToolTip = "Date Picker";

How to Set DatePicker Properties Using C#

Besides following C# example codes for setting DatePicker properties, we also provide the particular properties of DatePicker.
  • MaxDate/ MinDate: refers to the max date and mini date of datapicker
  • Culture: if apply this property, the text of datapicker can be adjustable
  • PopupDirection: with the support of this property, users can freely move datepicker to these four directions: TopLeft, TopRight, BottomLeft and BottomRight

PerDatePicker1.MinDate = new DateTime(2000, 1, 1);
PerDatePicker1.MaxDate = new DateTime(300, 1, 1);
PerDatePicker1.Culture = new CultureInfo("English");
PerDatePicker1.PopupDirection = DatePickerPopupDirection.BottomLeft;

How to Set DateInput Using C#

Before you use demo C# codes below to set DateInput, please read the brief introductions of all the attributes of DateInput.
  • DateFormat: can be used to set the format of input time
  • DisplayDateFormat: choose this attribute to display the format of time
  • Apprearance: of course, we are still able to set the appearance of dateinput, which includes backcolor, textcolor, Border, and so on so forth.

PerDatePicker1.DateInput.DateFormat = "d";
PerDatePicker1.DateInput.DisplayDateFormat = "d";
PerDatePicker1.DateInput.BackColor = System.Drawing.Color.Tomato;

How to Set Animation Using C#

With the support of Kettic UI Calender ASP.NET AJAX controls, users can have two choices for animation: ShowAnimation and HideAnimation. If you choose ShowAnimation, there will be animation together when the calendar popups and closes.

PerDatePicker1.ShowAnimation.Duration = 500;
PerDatePicker1.ShowAnimation.Type = CalendarAnimationType.Slide;
PerDatePicker1.Calendar.FastNavigationSettings.ShowAnimation.Duration = 500;
PerDatePicker1.Calendar.FastNavigationSettings.ShowAnimation.Type = CalendarAnimationType.Slide;

See More Tutorials

ASP.NET AJAX UI Controls