Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Calendar / Templates

  
Open the time view popup.

  • The example demonstrates how to use the HeaderTemplate, TimeTemplate, AlternatingTimeTemplate and FooterTemplate properties of the RadTimePicker control in order to customize the look of the control.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page CodeFile="DefaultCS.aspx.cs" Language="c#" AutoEventWireup="false" Inherits="Telerik.Web.Examples.Calendar.DateTimePicker.Templates.DefaultCS" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head runat="server">
            <qsf:HeadTag runat="server" ID="Headtag1"></qsf:HeadTag>
            <link href="styles.css" rel="stylesheet" type="text/css" />
        </head>
        <body class="BODY">
            <form id="Form1" method="post" runat="server">
            <qsf:Header id="Header1" runat="server" NavigationLanguage="CS" ShowSkinChooser="false"></qsf:Header>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
            function ClosePopup()
            {
                var dateTimePicker = $find("<%= RadTimePicker1.ClientID %>");
                dateTimePicker.hideTimePopup();
            }
            </script>
            </telerik:RadCodeBlock>
            <div class="mainWrap">
            <div class="pickerWrap">
            <label for="RadTimePicker1_dateInput_text">Start time:</label>
            &nbsp;&nbsp;
            <telerik:RadTimePicker ID="RadTimePicker1" Skin="Forest" runat="server" Width="120px">
                <TimeView runat="server" BorderStyle="None" BackColor="#2a3508"
                    StartTime="09:00:00"
                    EndTime="17:00:10">
                    <HeaderTemplate>
                        <div class="headerTemplate">Time Picker</div>
                    </HeaderTemplate>
                    <TimeTemplate>
                        <div class="itemt"><%# DataBinder.Eval(Container, "DataItem.Time", "{0:hh:mm tt}") %></div>
                    </TimeTemplate>
                    <AlternatingTimeTemplate>
                        <div class="itemt"><%# DataBinder.Eval(Container, "DataItem.Time", "{0:hh:mm tt}") %></div>
                    </AlternatingTimeTemplate>
                    <FooterTemplate>
                        <div class="footerTemplate"><button onclick="javascript:ClosePopup();return false;">Close</button></div>
                    </FooterTemplate>
                </TimeView>
                <DateInput BackColor="#89980c" />
                <TimePopupButton HoverImageUrl="img/clockHover.gif" ImageUrl="img/clock.gif" />
            </telerik:RadTimePicker>
            </div>
            </div>
            <qsf:Footer id="Footer2" runat="server"></qsf:Footer>
            </form>
        </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451