menu

ASP.NET MVC

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DateTimePicker

    Show / Hide Table of Contents

    Class DateTimePicker

    Represents the DateTimePicker UI element.

    Inheritance
    System.Object
    CommonControl
    DateTimePicker
    Implements
    System.Web.UI.INamingContainer
    System.Web.UI.IPostBackEventHandler
    System.Web.UI.IPostBackDataHandler
    System.Web.UI.IUrlResolutionService
    Inherited Members
    CommonControl.RaisePostBackEvent(String)
    CommonControl.OnInit(EventArgs)
    CommonControl.OnLoad(EventArgs)
    Namespace: Syncfusion.JavaScript.Web
    Assembly: Syncfusion.EJ.Web.dll
    Syntax
    public class DateTimePicker : CommonControl, INamingContainer, IPostBackEventHandler, IPostBackDataHandler, IUrlResolutionService

    Constructors

    DateTimePicker()

    Declaration
    public DateTimePicker()

    Properties

    AllowEdit

    Gets or sets a value indicating the date time picker input field editable or not.

    Declaration
    public bool AllowEdit { get; set; }
    Property Value
    Type Description
    System.Boolean

    ClientSideOnBeforeClose

    Gets or sets a value indicating this event gets fired before DateTimePicker popup closes.

    Declaration
    public string ClientSideOnBeforeClose { get; set; }
    Property Value
    Type Description
    System.String

    ClientSideOnBeforeOpen

    Gets or sets a value indicating this event gets fired before DateTimePicker popup opens.

    Declaration
    public string ClientSideOnBeforeOpen { get; set; }
    Property Value
    Type Description
    System.String

    ClientSideOnChange

    Gets or sets a value indicating this event gets fired when the date or time value changed in the DateTimePicker textbox.

    Declaration
    public string ClientSideOnChange { get; set; }
    Property Value
    Type Description
    System.String

    ClientSideOnClose

    Gets or sets a value indicating this event gets fired when DateTimePicker popup closes.

    Declaration
    public string ClientSideOnClose { get; set; }
    Property Value
    Type Description
    System.String

    ClientSideOnCreate

    Gets or sets a value indicating this event gets fired when DateTimePicker control is created.

    Declaration
    public string ClientSideOnCreate { get; set; }
    Property Value
    Type Description
    System.String

    ClientSideOnDestroy

    Gets or sets a value indicating this event gets fired when the DateTimePicker is destroyed successfully.

    Declaration
    public string ClientSideOnDestroy { get; set; }
    Property Value
    Type Description
    System.String

    ClientSideOnFocusIn

    Gets or sets a value indicating this event gets fired when DateTimePicker input field receives focus.

    Declaration
    public string ClientSideOnFocusIn { get; set; }
    Property Value
    Type Description
    System.String

    ClientSideOnFocusOut

    Gets or sets a value indicating this event gets fired when DateTimePicker input field loses focus.

    Declaration
    public string ClientSideOnFocusOut { get; set; }
    Property Value
    Type Description
    System.String

    ClientSideOnOpen

    Gets or sets a value indicating this event gets fired when DateTimePicker popup opens.

    Declaration
    public string ClientSideOnOpen { get; set; }
    Property Value
    Type Description
    System.String

    CssClass

    Gets or sets the root CSS class to DateTimePicker for theme customization.

    Declaration
    public string CssClass { get; set; }
    Property Value
    Type Description
    System.String

    DateTimeFormat

    Gets or sets the date time format to be displayed in DateTimePicker's input field.

    Declaration
    public string DateTimeFormat { get; set; }
    Property Value
    Type Description
    System.String

    DateTimePickerButtonText

    Gets or sets the value indicating custom text for the buttons inside the DateTimePicker popup.

    Declaration
    [JsonProperty("buttonText")]
    public ButtonText DateTimePickerButtonText { get; set; }
    Property Value
    Type Description
    ButtonText

    DateTimePickerDrillDown

    Gets or sets a value indicating drilldown to multiple levels of view (hours/minutes/seconds) in DateTimePicker popup.

    Declaration
    [JsonProperty("timeDrillDown")]
    public TimeDrillDown DateTimePickerDrillDown { get; set; }
    Property Value
    Type Description
    TimeDrillDown

    DayHeaderFormat

    Gets or sets a value indicating the header format of days in the calendar.

    Declaration
    public Header DayHeaderFormat { get; set; }
    Property Value
    Type Description
    Header

    DepthLevel

    Gets or sets a value indicating the navigation drill down level in the calendar. This is applicable when start level view is lower than depth level view.

    Declaration
    public Period DepthLevel { get; set; }
    Property Value
    Type Description
    Period

    EnableAnimation

    Gets or sets the value indicating the animation effect when DateTimePicker popup opens/closes.

    Declaration
    public bool EnableAnimation { get; set; }
    Property Value
    Type Description
    System.Boolean

    Enabled

    Gets or sets a value indicating whether the control can respond to user interaction.

    Declaration
    public bool Enabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnablePersistence

    Gets or set the value indicating DateTimePicker model value even after form post back/browser refresh sustains or not.

    Declaration
    public bool EnablePersistence { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnableRTL

    Gets or sets the value to align the input field and popup in right to left direction.

    Declaration
    public bool EnableRTL { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnableStrictMode

    Gets or sets a value to allow the invalid date in the DateTimePicker input field.

    Declaration
    public bool EnableStrictMode { get; set; }
    Property Value
    Type Description
    System.Boolean

    HeaderFormat

    Gets or sets a value indicating the header format to be displayed in the calendar inside the DateTimePicker popup.

    Declaration
    public string HeaderFormat { get; set; }
    Property Value
    Type Description
    System.String

    Height

    Gets or sets a value indicating the height of the DateTimePicker input field.

    Declaration
    public string Height { get; set; }
    Property Value
    Type Description
    System.String

    HtmlAttributes

    Declaration
    public IDictionary<string, object> HtmlAttributes { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Object>

    Interval

    Gets or sets a value indicating the time interval(in minutes) between the two adjacent time values in the time popup.

    Declaration
    public int Interval { get; set; }
    Property Value
    Type Description
    System.Int32

    Locale

    Gets or sets the culture to display the DateTimePicker in the specified culture.

    Declaration
    public string Locale { get; set; }
    Property Value
    Type Description
    System.String

    MaxDateTime

    Gets or sets a value indicating the maximum value of the DateTimePicker.

    Declaration
    public DateTime? MaxDateTime { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTime>

    MinDateTime

    Gets or sets a value indicating the minimum value of the DateTimePicker.

    Declaration
    public DateTime? MinDateTime { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTime>

    Model

    Gets or sets the DateTimePicker model object of the DateTimePicker properties.

    Declaration
    public DateTimePickerProperties Model { get; set; }
    Property Value
    Type Description
    DateTimePickerProperties

    Name

    Specifies the Name of the DateTimePicker

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    System.String

    ReadOnly

    Gets or sets a value indicating editing/selecting the date/time in DateTimePicker is allowed or not.

    Declaration
    public bool ReadOnly { get; set; }
    Property Value
    Type Description
    System.Boolean

    ShowOtherMonths

    Gets or sets the value indicating days of adjacent months in the current month calendar of DateTimePicker.

    Declaration
    public bool ShowOtherMonths { get; set; }
    Property Value
    Type Description
    System.Boolean

    ShowPopupButton

    Gets or sets the value indicating DateTime icon button in the input field.

    Declaration
    public bool ShowPopupButton { get; set; }
    Property Value
    Type Description
    System.Boolean

    ShowRoundedCorner

    Gets or sets the value indicating the DateTimePicker input field and popup with rounded corners or not

    Declaration
    public bool ShowRoundedCorner { get; set; }
    Property Value
    Type Description
    System.Boolean

    StartDay

    Gets or sets a value indicating the calendar's start day of the week in the DateTimePicker popup.

    Declaration
    public int StartDay { get; set; }
    Property Value
    Type Description
    System.Int32

    StartLevel

    Gets or sets a value indicating the start level (days/month/year) view in the calendar.

    Declaration
    public Period StartLevel { get; set; }
    Property Value
    Type Description
    Period

    StepMonths

    Gets or sets a value indicating the number of months to navigate for one click of next and previous buttons in DateTimePicker popup.

    Declaration
    public int StepMonths { get; set; }
    Property Value
    Type Description
    System.Int32

    TimeDisplayFormat

    Gets or sets the time format to be displayed as time values in the DateTimePicker popup.

    Declaration
    public string TimeDisplayFormat { get; set; }
    Property Value
    Type Description
    System.String

    TimePopupWidth

    Gets or sets the width of the time dropdown inside DateTimePicker popup.

    Declaration
    public int TimePopupWidth { get; set; }
    Property Value
    Type Description
    System.Int32

    TimeZone

    Gets or sets the TimeZone to display the DateTimePicker value with considered local time zone value.

    Declaration
    public bool TimeZone { get; set; }
    Property Value
    Type Description
    System.Boolean

    ValidationMessage

    Gets or sets validation messages for DateTimePicker input.

    Declaration
    public List<KeyValue> ValidationMessage { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<KeyValue>

    ValidationMessages

    Gets or sets validation messages for DateTimePicker input.

    Declaration
    public List<KeyValue> ValidationMessages { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<KeyValue>

    ValidationMsg

    Gets or sets jQuery validation messages for DateTimePicker input.

    Declaration
    [JsonProperty("validationMessage")]
    protected Dictionary<string, object> ValidationMsg { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>

    ValidationMsgs

    Gets or sets jQuery validation messages for DateTimePicker input.

    Declaration
    [JsonProperty("validationMessages")]
    protected Dictionary<string, object> ValidationMsgs { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>

    ValidationRule

    Gets or sets validation rules for DateTimePicker input.

    Declaration
    public List<KeyValue> ValidationRule { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<KeyValue>

    ValidationRules

    Gets or sets jQuery validation custom rules for DateTimePicker input.

    Declaration
    [JsonProperty("validationRules")]
    public Dictionary<string, object> ValidationRules { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>

    Value

    Gets or sets the value in the DateTimePicker.

    Declaration
    public DateTime? Value { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTime>

    WatermarkText

    Gets or sets the place holder value for DateTimePicker input field.

    Declaration
    public string WatermarkText { get; set; }
    Property Value
    Type Description
    System.String

    Width

    Gets or sets a value indicating the width of the DateTimePicker input field.

    Declaration
    public string Width { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    DependentScripts()

    Specifies the dependent scripts.

    Declaration
    public List<string> DependentScripts()
    Returns
    Type Description
    System.Collections.Generic.List<System.String>

    GetDependentFiles()

    Specifies the the dependent files.

    Declaration
    public override List<string> GetDependentFiles()
    Returns
    Type Description
    System.Collections.Generic.List<System.String>
    Overrides
    CommonControl.GetDependentFiles()

    LoadViewState(Object)

    Restores view-state information from a previous page request.

    Declaration
    protected override void LoadViewState(object state)
    Parameters
    Type Name Description
    System.Object state
    Overrides
    CommonControl.LoadViewState(Object)

    OnPreRender(EventArgs)

    Modifying server controls before sending them to the client.

    Declaration
    protected override void OnPreRender(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    PostBackEventHandler(String, Dictionary<String, Object>)

    Specifies the handler for server side events.

    Declaration
    public override void PostBackEventHandler(string EventName, Dictionary<string, object> args)
    Parameters
    Type Name Description
    System.String EventName
    System.Collections.Generic.Dictionary<System.String, System.Object> args
    Overrides
    CommonControl.PostBackEventHandler(String, Dictionary<String, Object>)

    Render()

    Renders the DateTimePicker instance.

    Declaration
    public string Render()
    Returns
    Type Description
    System.String

    Render(HtmlTextWriter)

    Declaration
    protected override void Render(HtmlTextWriter writer)
    Parameters
    Type Name Description
    System.Web.UI.HtmlTextWriter writer
    Overrides
    CommonControl.Render(HtmlTextWriter)

    UpdateServerModel(Dictionary<String, Object>)

    Updates the server model with client model.

    Declaration
    public override void UpdateServerModel(Dictionary<string, object> ClientModel)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.Object> ClientModel
    Overrides
    CommonControl.UpdateServerModel(Dictionary<String, Object>)

    Events

    Change

    Specifies the server side OnChange event.

    Declaration
    public event DateTimePicker.DateTimePickerChangeEventHandler Change
    Event Type
    Type Description
    DateTimePicker.DateTimePickerChangeEventHandler

    FocusOut

    Specifies the server side OnFocusOut event.

    Declaration
    public event DateTimePicker.DateTimePickerFocusOutEventHandler FocusOut
    Event Type
    Type Description
    DateTimePicker.DateTimePickerFocusOutEventHandler

    Implements

    System.Web.UI.INamingContainer
    System.Web.UI.IPostBackEventHandler
    System.Web.UI.IPostBackDataHandler
    System.Web.UI.IUrlResolutionService
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved