ASPxTimeEdit Class

Represents an editor capable of displaying and editing time values.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.2.dll


public class ASPxTimeEdit :



Create a TimeEdit Control

Design Time

The ASPxTimeEdit control is available on the DX.21.2: Common Controls toolbox tab in the Microsoft Visual Studio IDE.

Drag the control onto a form and customize the control’s settings, or paste the control’s markup in the page’s source code.

<dx:ASPxTimeEdit ID="timeEdit" runat="server" DateTime="2009/11/01 15:31:34" Caption="Time Editor">
    <ClearButton DisplayMode="OnHover"></ClearButton>

Run Time

using DevExpress.Web;
protected void Page_Load(object sender, EventArgs e)
    ASPxTimeEdit timeEdit = new ASPxTimeEdit();
    timeEdit.ID = "timeEdit";

    DateTime value = new DateTime(2009, 11, 1, 15, 31, 34);
    timeEdit.DateTime = value;
    timeEdit.Caption = "Time Editor";
    timeEdit.ClearButton.DisplayMode = ClearButtonDisplayMode.OnHover;


DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.

The ASPxTimeEdit class represents an editor consisting of an edit region and a pair of spin buttons, which can be used to adjust the date-time value. This value is specified via the ASPxTimeEdit.DateTime property. Changing the editor’s edit value raises the ASPxTimeEdit.DateChanged event.

The appearance and position of spin buttons can be controlled using the settings available via the ASPxTimeEdit.SpinButtons property.

The ASPxTimeEdit allows editing date and time values by typing directly within it, or by clicking spin buttons to increment or decrement different portions of date and time values (months, days, hours, minutes or seconds).

The ASPxTimeEdit editor’s date and time editing functionality is realized by supporting masked input, by design. The edit mask depends upon the value of the ASPxTimeEdit.EditFormat property and can also be defined explicitly using the ASPxTimeEdit.EditFormatString property. The ASPxTextEdit.DisplayFormatString property allows you to specify the pattern used to format the editor’s value for display purposes when the editor is not focused.


The client-side equivalent of this editor control is represented by the ASPxClientTimeEdit object. The editor’s client-side API is enabled if the ASPxEditBase.EnableClientSideAPI property is set to true, or the ASPxEditBase.ClientInstanceName property is defined, or any client event is handled. Available client events can be accessed via the ASPxTimeEdit.ClientSideEvents property.