DateTimePicker - Server-Side Events

Event log

  • ItemCreated event fired: ItemIndex is - [-1]; ItemType is - Header;
  • ItemDataBound event fired: ItemIndex is - [-1]; ItemType is - Header;
  • ItemCreated event fired: ItemIndex is - [0]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [0]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [1]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [1]; ItemType is - AlternatingItem;
  • ItemCreated event fired: ItemIndex is - [2]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [2]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [3]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [3]; ItemType is - AlternatingItem;
  • ItemCreated event fired: ItemIndex is - [4]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [4]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [5]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [5]; ItemType is - AlternatingItem;
  • ItemCreated event fired: ItemIndex is - [6]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [6]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [7]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [7]; ItemType is - AlternatingItem;
  • ItemCreated event fired: ItemIndex is - [8]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [8]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [9]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [9]; ItemType is - AlternatingItem;
  • ItemCreated event fired: ItemIndex is - [10]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [10]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [11]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [11]; ItemType is - AlternatingItem;
  • ItemCreated event fired: ItemIndex is - [12]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [12]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [13]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [13]; ItemType is - AlternatingItem;
  • ItemCreated event fired: ItemIndex is - [14]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [14]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [15]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [15]; ItemType is - AlternatingItem;
  • ItemCreated event fired: ItemIndex is - [16]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [16]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [17]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [17]; ItemType is - AlternatingItem;
  • ItemCreated event fired: ItemIndex is - [18]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [18]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [19]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [19]; ItemType is - AlternatingItem;
  • ItemCreated event fired: ItemIndex is - [20]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [20]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [21]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [21]; ItemType is - AlternatingItem;
  • ItemCreated event fired: ItemIndex is - [22]; ItemType is - Item;
  • ItemDataBound event fired: ItemIndex is - [22]; ItemType is - Item;
  • ItemCreated event fired: ItemIndex is - [23]; ItemType is - AlternatingItem;
  • ItemDataBound event fired: ItemIndex is - [23]; ItemType is - AlternatingItem;
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB
In this example we demonstrate the 3 main server-side events:
  • SelectedDateChanged - it fires if a date or time is selected and the AutoPostbackControl property is set to TimeView or Both.
  • ItemCreated - it fires when the time cell is creating
  • ItemDataBound - it fires when the time cell is binding to data.
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
<%@ Page CodeFile="DefaultCS.aspx.cs" Language="c#" Inherits="Telerik.Web.Examples.Calendar.DateTimePicker.ServerSideEvents.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>Telerik ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-thin" runat="server" id="containerDiv">
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadTimePicker1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTimePicker1"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="EventLogConsole1"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
       <h3>RadDateTimePicker</h3>
    <telerik:RadDateTimePicker RenderMode="Lightweight" AutoPostBackControl="Both" Width="100%" ID="RadTimePicker1" runat="server"
        OnItemCreated="RadTimePicker1_ItemCreated" OnItemDataBound="RadTimePicker1_ItemDataBound"
        OnSelectedDateChanged="RadTimePicker1_SelectedDateChanged">
    </telerik:RadDateTimePicker>
    </div>
    <qsf:EventLogConsole runat="server" ID="EventLogConsole1"></qsf:EventLogConsole>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?