Navigating the date picker.

The user can navigate the date picker in a couple ways. First, the user can scroll to previous or next months using scroll arrows that appear to the left of the top left month's header and to the right for the top right month's header:

Users can also navigate to other months by clicking on a month header and selecting another month from a drop down. The drop down itself scrolls when the user moves the mouse beyond the top or bottom edges of the drop down.

There are some settings you can use to limit or customize user navigation. The MonthDelta property can be used to set the number of months scrolled at a time to a value greater than one, which is the default. For example, if you have four months displayed to the user, you can choose to scroll four months at a time. You can also set limits to how far the user can scroll by setting the Range property. For instance, you can limit a user to scroll only 1 year back or 1 year ahead.

You can respond to user scrolling by capturing the OnMonthChange event. This event fires anytime the first month changes, whether the user scrolled using the scroll arrows or the month header drop downs. The event's parameters will tell you the new first month.

To programmatically scroll the control in a certain direction, use the ScrollLeft or ScrollRight methods. Or use the FirstMonth property to programmatically scroll to any arbitrary month.

MonthDeltaRangeOnMonthChangeScrollLeftScrollRightFirstMonth

  • No labels