MindFusion.UI for WebForms Programmer's Guide

DatePicker

The DatePicker control represents a text-box control with the ability to parse and select dates from a popup calendar.

Server side

  • Getting and setting the control's value
    Use the DatePicker.Value property to get or set the control's value.

  • Customizing the control
    The DatePicker control exposes a set of properties, allowing full control over user input. You can specify the format in which the input is expected by setting the CustomDateFormat property. By using MinDate and MaxDate properties you can limit the input to a specified date range and by setting the AllowEmptyInput property you can define whether or not empty string values are considered valid for the control.
    Adjust the interaction with the control by setting the SubmitOnEnter and DatePartSelect properties according to your needs.
    The control offers a built-in functionality for parsing incomplete user input which can be enabled by setting the AutoComplete property.
    The position of the popup calendar can be adjusted by using the PopupAlignRight and PopupAlignTop properties.

  • Events
    The following events are exposed by the DatePicker class.

    Event

    Event arguments

    Description

    ValueChanged

    ValueChangedEventArgs<Nullable<DateTime>>

    Raised when the control's value has changed.

Client side

  • Getting a reference to the control
    You can access the control on the client side by its ClientID.
     
    JavaScript  Copy Code
    var datePicker = $find("DatePicker1");
    var datePicker = $find("<%= DatePicker1.ClientID %>");


  • Getting and setting the control's value
    Use the get_value and set_value methods to get or set the control's value.

    JavaScript  Copy Code

    datePicker.set_value(new Date(2010,0,1));
    alert(datePicker.get_value());