<script type="text/javascript" >
//override the onload event handler to change the picker after the page is loaded
window.onload = function ()
{
window.setTimeout(function() {SetCalendarTable();},200)
}
function SetCalendarTable()
{
var picker = $find("<%= RadDatePicker1.ClientID %>");
var calendar = picker.GetCalendar();
var fastNavigation = calendar.GetFastNavigation();
picker.PopupButton.onclick =
function()
{
var textbox = picker.GetTextBox();
//adjust where to show the popup table
var x, y;
var adjustElement = textbox;
if (textbox.style.display == "none")
adjustElement = picker.popupImage();
var pos = picker.GetElementPosition(adjustElement);
x = pos.x;
y = pos.y + adjustElement.offsetHeight;
var e = {
clientX : x,
clientY : y
};
//synchronize the input date if set with the picker one
var date = picker.GetDate();
if(date)
{
calendar.FocusedDate[0] = date.getFullYear();
calendar.FocusedDate[1] = date.getMonth() + 1;
}
document.getElementById(calendar.TitleID).onclick(e);
}
fastNavigation.OnOK =
function()
{
var date = new Date(fastNavigation.Year, fastNavigation.Month, 1);
picker.DateInput.SetDate(date);
fastNavigation.Popup.Hide();
}
fastNavigation.OnToday =
function()
{
var date = new Date();
picker.DateInput.SetDate(date);
fastNavigation.Popup.Hide();
}
}
</script>