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.
Handling invalid user input Handle the stateChanged and/or valueInvalid events to apply special processing in case of invalid user input, e.g. change the CSS class of the control's date input.
JavaScript
Copy Code
function onStateChanged(sender, args) { if (args.getNewState() == MindFusion.UI.Web.ValidationState.Invalid) { Sys.UI.DomElement.addCssClass(sender.Dom.textbox, "invalid"); } else { Sys.UI.DomElement.removeCssClass(sender.Dom.textbox, "invalid"); } }
Events The following client-side event are exposed by the DatePicker class.