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 / TimePicker/First look

Select time:
Configurator


Start time:
End time:
Interval:

Set tooltip:
Choose format for TimeView and DateInput:


Number of columns in TimeView:

Select popup expand direction:
Select rendering direction:

  • The RadTimePicker control is used to allow the user to select time and to display that time in the specified format and culture. You can limit the time values that can be selected by setting the StartTime and EndTime properties. The Interval property allows the user to specify the interval between time slots available for selection. Moreover, you can:

    • Customize the display time format for the time input and TimeView popup
    • Choose the number of columns displayed in the TimeView
    • Select popup expand direction and render direction for the TimeView
    • Show the popup when the input field is focused
    • Set custom tooltip for the time popup image, etc.
    • Enable shadow effect for the TimeView component.

    If you want to allow the time value to be entered in the input field only (without using the RadTimePicker's popup), there is an option to hide the time popup image by setting the RadTimePickerInstance.TimePopupButton.Visible property.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page CodeFile="DefaultCS.aspx.cs" Language="c#" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Calendar.DateTimePicker.Overview.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" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <!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>
    </head>
    <body class="BODY">
        <form id="Form1" method="post" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="CS"></qsf:Header>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="chkShowHideTimePopUp">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="chkShowPopUpOnFocus">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="chkEnableShadows">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnToolTip">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnApplyStartEndTime">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="ddlTimeInterval">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="ddlFormat">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="ddlTimeViewLayout">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="ddlPopupDirection">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rblRenderDirection">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rblRenderDirection" />
                        <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <div style="height: 50px">
        </div>
        <span style="margin-right: 5px;">Select time:</span>
        <telerik:RadTimePicker ID="RadTimePicker1" runat="server" ZIndex="30001" />
        <div style="height: 50px">
        </div>
        <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Title="Configurator"
            Expanded="true">
            <table>
                <tr>
                    <td>
    <asp:CheckBox runat="server" ID="chkShowHideTimePopUp" Text="Show/hide time popup button"
    AutoPostBack="True" OnCheckedChanged="chkShowHideTimePopUp_CheckedChanged"></asp:CheckBox>

                        <br />
    <asp:CheckBox runat="server" ID="chkShowPopUpOnFocus" Text="Show popup on focus"
    AutoPostBack="True" OnCheckedChanged="chkShowPopUpOnFocus_CheckedChanged"></asp:CheckBox>

                        <br />
    <asp:CheckBox runat="server" ID="chkEnableShadows" Text="Enable shadows" AutoPostBack="True"
    OnCheckedChanged="chkEnableShadows_CheckedChanged"></asp:CheckBox>

                        <table>
                            <tr>
                                <td>
                                </td>
                                <td style="width: 150px;">
    <asp:CompareValidator ID="StartEndTimeCompareValidator" runat="server" ControlToValidate="txtBoxEndTime"
    ControlToCompare="txtBoxStartTime" Type="Integer" Operator="GreaterThan" ErrorMessage="End time must be greater than start time" />

                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Start time:
                                </td>
                                <td>
                                    <telerik:RadNumericTextBox ID="txtBoxStartTime" runat="server" MinValue="0" MaxValue="23"
                                        NumberFormat-AllowRounding="false" NumberFormat-KeepNotRoundedValue="true" />
                                </td>
                                <td rowspan="3">
    <asp:Button ID="btnApplyStartEndTime" runat="server" Text="Apply start/end time"
    OnClick="btnApplyStartEndTime_Click" Width="100%" />

                                </td>
                            </tr>
                            <tr>
                                <td>
                                    End time:
                                </td>
                                <td>
                                    <telerik:RadNumericTextBox ID="txtBoxEndTime" runat="server" MinValue="0" MaxValue="23"
                                        NumberFormat-AllowRounding="false" NumberFormat-KeepNotRoundedValue="true" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Interval:
                                </td>
                                <td>
    <asp:DropDownList ID="ddlTimeInterval" runat="server" Width="130px" AutoPostBack="True"
    OnSelectedIndexChanged="ddlTimeInterval_SelectedIndexChanged">

                                        <asp:ListItem Value="10">10 min</asp:ListItem>
                                        <asp:ListItem Value="15">15 min</asp:ListItem>
                                        <asp:ListItem Value="30">30 min</asp:ListItem>
                                        <asp:ListItem Value="1">60 min (default)</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                        </table>
                        <br />
                        <table>
                            <tr>
                                <td>
                                    Set tooltip:
                                </td>
                                <td>
                                    <asp:TextBox ID="tooltipBox" runat="server" Width="200px" />
                                </td>
                                <td>
                                    <asp:Button ID="btnToolTip" runat="server" Text="Apply tooltip" OnClick="btnToolTip_Click" />
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        Choose format for TimeView and DateInput:
                        <br />
                        <asp:DropDownList ID="ddlFormat" runat="server" Width="80%" AutoPostBack="True" OnSelectedIndexChanged="ddlFormat_SelectedIndexChanged">
                            <asp:ListItem Value="t">t (default)</asp:ListItem>
                            <asp:ListItem Value="HH:mm">HH:mm</asp:ListItem>
                            <asp:ListItem Value="HH:mm:ss">HH:mm:ss</asp:ListItem>
                        </asp:DropDownList>
                        <br />
                        <br />
                        Number of columns in TimeView:
    <asp:DropDownList runat="server" ID="ddlTimeViewLayout" Width="80%" AutoPostBack="True"
    OnSelectedIndexChanged="ddlTimeViewLayout_SelectedIndexChanged">

                            <asp:ListItem Value="2">2 columns</asp:ListItem>
                            <asp:ListItem Value="3">3 columns (default)</asp:ListItem>
                            <asp:ListItem Value="4">4 columns</asp:ListItem>
                            <asp:ListItem Value="5">5 columns</asp:ListItem>
                        </asp:DropDownList>
                        <br />
                        <br />
                        Select popup expand direction:
    <asp:DropDownList runat="server" ID="ddlPopupDirection" Width="80%" AutoPostBack="True"
    OnSelectedIndexChanged="ddlPopupDirection_SelectedIndexChanged">

                            <asp:ListItem Value="BottomRight">BottomRight(default)</asp:ListItem>
                            <asp:ListItem Value="BottomLeft">BottomLeft</asp:ListItem>
                            <asp:ListItem Value="TopRight">TopRight</asp:ListItem>
                            <asp:ListItem Value="TopLeft">TopLeft</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td style="width: 150px;">
                        Select rendering direction:
                        <br />
                        <asp:RadioButtonList ID="rblRenderDirection" runat="server" AutoPostBack="True" OnSelectedIndexChanged="rblRenderDirection_SelectedIndexChanged">
                            <asp:ListItem Value="1">Render in Rows</asp:ListItem>
                            <asp:ListItem Value="2">Render in Columns</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
            </table>
        </qsf:ConfiguratorPanel>
        <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