Advanced DateTimePicker Control

Advanced Date/Time Picker control is written from ground up to provide exceptional customization options with great out of box look and feel and seamless international support. Office 2007 style is default style for this control and it will fit great with our other Office 2007 style data input controls. We implemented all features from standard Date/Time Picker control and while doing so removed all common limitations. You can provide easy date, time or date and time data entry in your application with advanced date/time picker.

Advanced Date/Time Picker control natively supports NULL values which is one of the most common complaints about standard Date/Time Picker. This is must have feature if you are binding control to the database fields. In addition to that, we support completely custom parsing of the input values. Simply handle ParseValue event and you can bind control to any field type and custom process its value before it is assigned to the control.

Look and feel

Advanced Date/Time Picker has Highlight on focus feature that our other input controls have as well. This makes it much easier to spot currently focused control on the form. This is how the Date/Time Picker control looks with default settings and Clear button visible:

DateTimePicker control in Office 2007 style with drop-down calendar and clear button

Control update can be locked and unlocked using the check-box that can be displayed on the left hand side of the control. You can also show the up/down scrolling buttons that allow user to change the currently focused date/time part by simply pressing the buttons. Image below shows these parts of the control activated:

DateTimePicker control lock/unlock and up/down buttons

Display up to 2 custom buttons inside of the Date/Time Picker and assign to them any combination of image and text. Use custom buttons to display custom dialog to choose control value, perform lookups etc. Image below shows one of the custom buttons visible:

DateTimePicker control with custom buttons

Control look and feel can be completely customized, including the most important part, the drop-down calendar. You can mark recurring dates on calendar on monthly and annual basis. You can also mark dates based on absolute values. In screen-shot below we marked 11th, 18th and 21st day of each month using the colors we specified. We also customized calendar background and navigation background all using designer and without writing single line of code.

DateTimePicker control with custom buttons

If you want to perform custom rendering on control's calendar you can do so easily by handling PaintLabel event which occurs before each day on calendar is rendered. Provide completely custom look or combine yours and our rendering, the choice is yours. Image below shows custom rendering combined with internal control rendering:

DateTimePicker custom calendar rendering

Date/Time Formats, Custom Formatting and Beyond

Advanced Date/Time Picker is fully internationally aware. Long and short date format and long and short time formats, as specified in end-user system options, are built-in formats. Full strength of control can be seen when custom format is used.

Setting the custom format property value to: 'at' HH 'hours and' mm 'minutes' results in the input shown below:

DateTimePicker custom formatting

You can even create format to enter date range using single Advanced Date/Time Picker control. Setting custom format value to: 'Starting from:' MM/dd/yyyy ' until' {MM/dd/yyyy} results in input shown below:

DateTimePicker custom formatting for entry of date ranges

Using the Values property you can retrieve the array of date/time values that was entered.

Free-Text Input

By default control uses the formatted field based input. DateTimeInput also supports free-text entry mode which allows free-text value entry.

ButtonFreeText property is used to hide/show free text button , change its image etc. Using FreeTextEntryMode property you can toggle the free-text entry mode from code. You can also set AutoOffFreeTextEntry property to false to turn-off free-text entry automatically when input field loses focus.

The support for custom parsing of entered values is available as well. Handle the ConvertFreeTextEntry event, parse the ValueEntered, set the ControlValue to the typed value you want control to use, set IsValueConverted=true to indicate that you parsed it and that’s all that needs to be done to parse any custom value entered.

Some simple built-in parsing for values in DateTimeInput is included, so in free text entry mode you can type: today, now, tomorrow or yesterday and control will fill in desired date and time.

Download fully functional trial of DotNetBar Suite for Windows Forms now and experience how easy it is to create professional looking applications.