New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Adding Controls to a Calendar Cell

There are two possible approaches for adding controls to a ASP NET AJAX Calendar cell:

  • You can add controls to a Day template and assign the template to one or more special days in the calendar. This approach is useful when you want to add controls on a "per day" basis. For details on how to create and use day templates, see Day Templates.

  • You can use the DayRender event to add the controls to every cell of the calendar just before it is rendered on the client:

C#
protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e) 
{ 
    Label label = new Label();
    label.Text = e.Day.Date.Day.ToString();
    e.Cell.Controls.Add(label);
    label = new Label();
    label.Text = e.Day.Date.DayOfWeek.ToString();
    e.Cell.Controls.Add(label); 
}
Not finding the help you need?
Contact Support