This is a migrated thread and some comments may be shown as answers.

Adding Extra Field in the RadCalendar TitleBar

1 Answer 22 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
ravi shankar
Top achievements
Rank 1
ravi shankar asked on 06 Sep 2010, 12:01 PM
Hi Telerik,

I want to display the selected day on the RadCalendar Title Bar.

Similar to 21st Month Label in titlebar of Attached Image.

Please help me to sort out this issue.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 07 Sep 2010, 11:17 AM
Hello Ravi,

Unfortunately, RadCalendar does not support the layout, shown on your screenshot. You can achieve a similar look like in the demo below. Feel free to further customize the appearance of the HeaderTemplate.

<%@ Page Language="C#" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<script runat="server">
 
    protected void Label1_Load(object sender, EventArgs e)
    {
        (sender as Label).DataBind();
    }
     
    protected string GetCalendarDate(RadCalendar cal)
    {
        if (cal.SelectedDate > cal.RangeMinDate)
            return cal.SelectedDate.Day.ToString() + " " + cal.SelectedDate.DayOfWeek.ToString();
        else
            return "";
    }
     
</script>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
<head runat="server">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>RadControls</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
 
<telerik:RadCalendar ID="RadCalendar1" runat="server" AutoPostBack="true" EnableMultiSelect="false">
    <HeaderTemplate>
         <asp:Label ID="Label1" runat="server" Text='<%# GetCalendarDate(RadCalendar1) %>' OnLoad="Label1_Load" />
    </HeaderTemplate>
</telerik:RadCalendar>
 
</form>
</body>
</html>


Sincerely yours,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Calendar
Asked by
ravi shankar
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or