Calendar

Controls

Rate this demo

Thank you for your post!
Submit a support ticket
If you have an active license or trial, you have access to dedicated support from Telerik’s developers. Response time is 24h for active licenses and 72h for trials, Mon-Fri.
Post in the forums
If you don’t have access to support or would like to help other people by sharing your problem, reach out to our active community in the forums.

TimePicker - First Look

Configurator


 










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.

C# VB
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="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">
    <title>ASP.NET Calendar Demo - First Look</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="chkShowHideTimePopUp">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="chkShowPopUpOnFocus">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="chkEnableShadows">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnToolTip">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnApplyStartEndTime">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ddlTimeInterval">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ddlFormat">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ddlTimeViewLayout">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ddlPopupDirection">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rblRenderDirection">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rblRenderDirection"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="RadTimePicker1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <div style="height: 50px">
    </div>
    <label for="RadTimePicker1">
        Select time:
    </label>
    <telerik:RadTimePicker ID="RadTimePicker1" runat="server">
    </telerik:RadTimePicker>
    <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"></asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="txtBoxStartTime">
                                    Start time:
                                </label>
                            </td>
                            <td>
                                <telerik:RadNumericTextBox ID="txtBoxStartTime" runat="server" MinValue="0" MaxValue="23"
                                    NumberFormat-AllowRounding="false" NumberFormat-KeepNotRoundedValue="true">
                                </telerik:RadNumericTextBox>
                            </td>
                            <td rowspan="3">
                                <asp:Button ID="btnApplyStartEndTime" runat="server" Text="Apply start/end time"
                                    OnClick="btnApplyStartEndTime_Click" Width="100%"></asp:Button>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="txtBoxEndTime">
                                    End time:
                                </label>
                            </td>
                            <td>
                                <telerik:RadNumericTextBox ID="txtBoxEndTime" runat="server" MinValue="0" MaxValue="23"
                                    NumberFormat-AllowRounding="false" NumberFormat-KeepNotRoundedValue="true">
                                </telerik:RadNumericTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="ddlTimeInterval">
                                    Interval:
                                </label>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlTimeInterval" runat="server" Width="160px" 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>
                                <label for="tooltipBox">
                                    Set tooltip:
                                </label>
                            </td>
                            <td>
                                <asp:TextBox ID="tooltipBox" runat="server" Width="200px"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Button ID="btnToolTip" runat="server" Text="Apply tooltip" OnClick="btnToolTip_Click">
                                </asp:Button>
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                    <label for="ddlFormat">
                        Choose format for TimeView and DateInput:
                    </label>
                    <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 />
                    <label for="ddlTimeViewLayout">
                        Number of columns in TimeView:
                    </label>
                    <br />
                    <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 />
                    <label for="ddlPopupDirection">
                        Select popup expand direction:
                    </label>
                    <br />
                    <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: 250px;">
                    <label for="rblRenderDirection">
                        Select rendering direction:
                    </label>
                    <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>
    </form>
</body>
</html>