Hi, I'm having a problem with the calendar control. My implementation calls for me to use my own previous/next month controls rather than the ones built into the navigation bar. I've placed a button on the page, and set a server-side event on it that calls like this:
calendar.FocusedDate = calendar.FocusedDate.AddMonths(1);
This works fine in changing the month, but when the page re-displays, the classes applied to all the day numbers are wrong, the numbers that belong to the previous month are shown in black but the ones for the current month are greyed out. It's as if the CSS is still showing the month I have paged away from as selected. If you hover over the individual day numbers, they reset themselves to the correct style. Any ideas on how to fix this?
Here is the code, I'm using Telerik assembly version 2008.3.1105.20:
testbed.aspx:
testbed.aspx.cs:
testbed.aspx.designer.cs:
Thanks,
calendar.FocusedDate = calendar.FocusedDate.AddMonths(1);
This works fine in changing the month, but when the page re-displays, the classes applied to all the day numbers are wrong, the numbers that belong to the previous month are shown in black but the ones for the current month are greyed out. It's as if the CSS is still showing the month I have paged away from as selected. If you hover over the individual day numbers, they reset themselves to the correct style. Any ideas on how to fix this?
Here is the code, I'm using Telerik assembly version 2008.3.1105.20:
testbed.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestBed.aspx.cs" Inherits="Twofour.MediaFreedom.Administration.TestBed" %> |
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
<!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>Test bed</title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
</telerik:RadScriptManager> |
<div> |
<asp:Button ID="btnNext" runat="server" Text="Go To Next Month >>" OnClick="btnNext_Click" /> |
</div> |
<telerik:RadCalendar ID="calendar" runat="server" /> |
</form> |
</body> |
</html> |
testbed.aspx.cs:
using System; |
using System.Web.UI; |
namespace Twofour.MediaFreedom.Administration |
{ |
public partial class TestBed : Page |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
} |
protected void btnNext_Click(object sender, EventArgs e) |
{ |
calendar.FocusedDate = calendar.FocusedDate.AddMonths(1); |
} |
} |
} |
testbed.aspx.designer.cs:
//------------------------------------------------------------------------------ |
// <auto-generated> |
// This code was generated by a tool. |
// Runtime Version:2.0.50727.3053 |
// |
// Changes to this file may cause incorrect behavior and will be lost if |
// the code is regenerated. |
// </auto-generated> |
//------------------------------------------------------------------------------ |
namespace Twofour.MediaFreedom.Administration { |
public partial class TestBed { |
/// <summary> |
/// form1 control. |
/// </summary> |
/// <remarks> |
/// Auto-generated field. |
/// To modify move field declaration from designer file to code-behind file. |
/// </remarks> |
protected global::System.Web.UI.HtmlControls.HtmlForm form1; |
/// <summary> |
/// RadScriptManager1 control. |
/// </summary> |
/// <remarks> |
/// Auto-generated field. |
/// To modify move field declaration from designer file to code-behind file. |
/// </remarks> |
protected global::Telerik.Web.UI.RadScriptManager RadScriptManager1; |
/// <summary> |
/// btnNext control. |
/// </summary> |
/// <remarks> |
/// Auto-generated field. |
/// To modify move field declaration from designer file to code-behind file. |
/// </remarks> |
protected global::System.Web.UI.WebControls.Button btnNext; |
/// <summary> |
/// calendar control. |
/// </summary> |
/// <remarks> |
/// Auto-generated field. |
/// To modify move field declaration from designer file to code-behind file. |
/// </remarks> |
protected global::Telerik.Web.UI.RadCalendar calendar; |
} |
} |
Thanks,