<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DatePicker1.aspx.cs" Inherits="Calendar_DatePicker1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="Sc1" runat="server"></asp:ScriptManager>
<telerik:RadDatePicker ID="RadDatePicker1" runat="server" />
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Globalization;
public partial class Calendar_DatePicker1 : System.Web.UI.Page
{
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
RadDatePicker1.MinDate = Convert.ToDateTime("10/1/2013");
RadDatePicker1.MaxDate = Convert.ToDateTime("10/10/2013");
RadDatePicker1.Culture = new CultureInfo("En");
RadDatePicker1.DateInput.DateFormat = "d";
RadDatePicker1.DatePopupButton.Visible = true;
RadDatePicker1.ShowPopupOnFocus = true;
RadDatePicker1.DatePopupButton.ToolTip = "Open the calender popup";
RadDatePicker1.EnableScreenBoundaryDetection = true;
RadDatePicker1.PopupDirection = (Telerik.Web.UI.DatePickerPopupDirection)Enum.ToObject(typeof(Telerik.Web.UI.DatePickerPopupDirection), Convert.ToInt32(1));
CalendarAnimationType animationType = (CalendarAnimationType)Enum.Parse(typeof(CalendarAnimationType), "Fade");
RadDatePicker1.ShowAnimation.Type = animationType;
RadDatePicker1.HideAnimation.Type = animationType;
RadDatePicker1.Calendar.FastNavigationSettings.ShowAnimation.Type = animationType;
RadDatePicker1.Calendar.FastNavigationSettings.HideAnimation.Type = animationType;
RadDatePicker1.ShowAnimation.Duration = (int)300;
RadDatePicker1.HideAnimation.Duration = (int)300;
RadDatePicker1.Calendar.FastNavigationSettings.ShowAnimation.Duration = (int)300;
RadDatePicker1.Calendar.FastNavigationSettings.HideAnimation.Duration = (int)300;
//The code below is used for the purposes of this demo and users are not encouraged to use it.
string script = String.Format("delete Telerik.Web.UI.RadDatePicker.PopupInstances['{0}'];", RadDatePicker1.Calendar.ClientID);
ScriptManager.RegisterStartupScript(Page, typeof(Page), "clearPickerPopup", script, true);
}
protected void Page_Load(object sender, EventArgs e)
{
}
}