Date Selection

Selecting one or more dates in the date picker.

Getting and Setting

Selecting items in the SRP DatePicker Control is simple. Just one property, the Selection property, meets all your selection needs. The selection is always an @FM delmited array of dates sorted chronologically. Simply pass a new array to change the selection or read the property to get the current selection.

Limits

Depending on your requirements, you may need to limit the number of dates the user may select. Two properties allow you to limit how the user selects dates. First, the MaxSelCount property allows you to set a limit to the total number of days the user can select. Increase this if you want the user to be able to select more than one date, which is the default. Second, the NoncontinuousSelection property can be used to allow the user to select multiple separate dates. By default, if you increase the MaxSelCount, then the user can only select that many dates in a row.

Buttons

For convenience, a button labelled "Today" appears at the bottom of the control. The user can click this button to select quickly today's date and, if necessary, bring that date into view. When the user does this, their current selection is replaced with only today's date. Use the TodayButtonVisible property to hide this button. Also, you can use the NoneButtonVisible property to show a button labelled "None" at the bottom of the control. This button simply clears the selection when the user clicks it.

Changes

Use the OnSelChange event to capture changes to the selection. The most recently selected data is provided in the first parameter. If, however, you enabled multiple selection, you'll want to read the Selection property explicitely to get the full list selected dates.

Visibility

The user can scroll to other months without affecting selection, but this means that sometimes the selection will be scrolled out of view. If you need to programmatically bring the selection back into view, or if you want to provide a way for the user to do this, then use the EnsureVisibleSelection method.

See Also

SelectionMaxSelCountNoncontinuousSelectionTodayButtonVisibleNoneButtonVisibleOnSelChangeEnsureVisibleSelection

  • No labels