New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Client-Side API

Event log
  • Demo Configurator
  • /MinTime
  • /MaxTime
  • /MinDate
  • /MaxDate

RadDateTimePicker exposes rich client-side API set which allows easy and flexible use in a wide range of application scenarios. In this example we demonstrate the main client-side functions:

TimePicker

  • showTimePopup
  • hideTimePopup
  • get_timeView()

  • set_enabled()
  • set_minDate()
  • set_maxDate()
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • scripts.js
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Calendar.DateTimePicker.ClientAPI.DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <script type="text/javascript" src="scripts.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function pageLoad() {
                demo.initialize($find("<%= RadDateTimePicker1.ClientID %>"));
            }
        </script>
    </telerik:RadCodeBlock>
    <div class="demo-container size-thin" runat="server" id="containerDiv">
        <h3>RadDateTimePicker</h3>
        <telerik:RadDateTimePicker RenderMode="Lightweight" ID="RadDateTimePicker1" Width="100%" runat="server">
            <TimeView ID="TimeView1" runat="server" OnClientTimeSelected="ClientTimeSelected">
            </TimeView>
        </telerik:RadDateTimePicker>
    </div>
    <qsf:EventLogConsole runat="server" ID="EventLogConsole1"></qsf:EventLogConsole>

    <qsf:ConfiguratorPanel ID="ConfigurationPanel1" runat="server" Title="Demo Configurator" Orientation="Vertical"
        Expanded="true">
        <Views>
            <qsf:View>
                <qsf:ConfiguratorColumn ID="ConfiguratorColumn2" runat="server" Size="Medium">
                    <ul class="fb-group">
                        <li>
                            <span class="checkbox">
                                <asp:CheckBox runat="server" ID="MinDate" Text="05:00 AM" onclick="setMinDateTime(this);"></asp:CheckBox> /MinTime</span>
                        </li>
                        <li>
                            <span class="checkbox">
                                <asp:CheckBox runat="server" ID="MaxDate" Text="08:00 PM" onclick="setMaxDateTime(this);"></asp:CheckBox> /MaxTime</span>
                        </li>
                    </ul>
                </qsf:ConfiguratorColumn>
                <qsf:ConfiguratorColumn ID="ConfiguratorColumn3" runat="server" Size="Medium">
                    <ul class="fb-group">
                        <li>
                            <span class="checkbox">
                                <asp:CheckBox runat="server" ID="CheckBox1" Text="2005/01/01" onclick="setMinDate(this);"></asp:CheckBox> /MinDate</span>
                        </li>
                        <li>
                            <span class="checkbox">
                                <asp:CheckBox runat="server" ID="CheckBox2" Text="2012/01/01" onclick="setMaxDate(this);"></asp:CheckBox> /MaxDate  </span>
                        </li>
                    </ul>
                </qsf:ConfiguratorColumn>
                <qsf:ConfiguratorColumn ID="ConfiguratorColumn1" runat="server" Size="Medium">
                    <ul class="fb-group">      
                        <li>
                            <qsf:Button ID="Button2" Text=" Clear DatePicker value" runat="server" Size="Auto" OnClientClicked="clearText" AutoPostBack="false"></qsf:Button>
                        </li>
                    </ul>
                </qsf:ConfiguratorColumn>
            </qsf:View>
        </Views>
    </qsf:ConfiguratorPanel>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance