Version

BeforeAlternateSelectedDateRangeChange Event

Fired before a change is made to the AlternateSelectedDateRanges collection.
Syntax
'Declaration
 
Public Event BeforeAlternateSelectedDateRangeChange As BeforeSelectedDateRangeChangeEventHandler
public event BeforeSelectedDateRangeChangeEventHandler BeforeAlternateSelectedDateRangeChange
Event Data

The event handler receives an argument of type BeforeSelectedDateRangeChangeEventArgs containing data related to this event. The following BeforeSelectedDateRangeChangeEventArgs properties provide information specific to this event.

PropertyDescription
Cancel (Inherited from System.ComponentModel.CancelEventArgs) 
DisplayMaxSelectedDaysErrorMsg Determines if the MaxSelectedDaysError dialog is displayed to the user.
NewSelectedDateRanges Returns a SelectedDateRanges object containing the date ranges that will be selected if the event is not cancelled. The property is read-only.
WasMaxSelectedDaysExceeded Indicates if the max selected items would have been exceeded by the selection change.
Remarks

The BeforeAlternateSelectedDateRangeChange event may be canceled (by setting the System.ComponentModel.CancelEventArgs.Cancel property to true) to prevent the AlternateSelectedDateRanges collection from changing.

The BeforeSelectedDateRangeChangeEventArgs.NewSelectedDateRanges property returns a collection of the new selected DateRange objects.

The BeforeSelectedDateRangeChangeEventArgs.WasMaxSelectedDaysExceeded property indicates whether the selection change would have been exceeded. When this is true, the BeforeSelectedDateRangeChangeEventArgs.DisplayMaxSelectedDaysErrorMsg property will be used to determine whether a dialog should be displayed to the user to indicate that the MaxAlternateSelectedDays property would have been exceeded.

While the event is in progress, the SelectedHolidays collection cannot be modified. However, the collection returned from the BeforeSelectedDateRangeChangeEventArgs.NewSelectedDateRanges property may be modified.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also