'Declaration Public ReadOnly Property SelectedDateRanges As SelectedDateRanges
public SelectedDateRanges SelectedDateRanges {get;}
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Imports System.Diagnostics Private Sub ultraCalendarInfo1_AfterSelectedDateRangeChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles ultraCalendarInfo1.AfterSelectedDateRangeChange '---------------------------------------------------------------------------------------------------- ' Description ' AfterSelectedDateRangeChange ' ' Fires after a range of days is selected or deselected. ' ' The SelectedDateRanges collection is actually a collection of collections, ' each "sub collection" representing the actual days that are selected. Each ' DateRange object represents a contiguous range of days that are all selected. ' When new days are selected, they are added to an existing DateRange object, ' if the new day is adjacent to a currently selected day. If it is not, a new DateRange ' object is added to the collection, which will at that point have only one day in it. ' '---------------------------------------------------------------------------------------------------- ' If there are no selected days, don't display the information If (Me.ultraCalendarInfo1.SelectedDateRanges.Count = 0) Then Return Dim info As String = String.Empty info += "The range of selected days has changed. The currently selected days are:" + vbCrLf + vbCrLf ' Iterate the SelectedDateRanges in the outer loop Dim range As Infragistics.Win.UltraWinSchedule.DateRange For Each range In Me.ultraCalendarInfo1.SelectedDateRanges ' Iterate the range's Days collection in the inner loop Dim day As Infragistics.Win.UltraWinSchedule.Day For Each day In range.Days ' Append each day's information to the info string info += day.Date.ToLongDateString() + vbCrLf Next Next ' Display the information MessageBox.Show(info, "AfterSelectedDateRangeChange", MessageBoxButtons.OK) End Sub
using System.Diagnostics; using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; private void ultraCalendarInfo1_AfterSelectedDateRangeChange(object sender, System.EventArgs e) { //---------------------------------------------------------------------------------------------------- // Description // AfterSelectedDateRangeChange // // Fires after a range of days is selected or deselected. // // The SelectedDateRanges collection is actually a collection of collections, // each "sub collection" representing the actual days that are selected. Each // DateRange object represents a contiguous range of days that are all selected. // When new days are selected, they are added to an existing DateRange object, // if the new day is adjacent to a currently selected day. If it is not, a new DateRange // object is added to the collection, which will at that point have only one day in it. // //---------------------------------------------------------------------------------------------------- // If there are no selected days, don't display the information if ( this.ultraCalendarInfo1.SelectedDateRanges.Count == 0 ) return; string info = string.Empty; info += "The range of selected days has changed. The currently selected days are:" + "\n\n"; // Iterate the SelectedDateRanges in the outer loop foreach( DateRange range in this.ultraCalendarInfo1.SelectedDateRanges ) { // Iterate the range's Days collection in the inner loop foreach( Infragistics.Win.UltraWinSchedule.Day day in range.Days ) { // Append each day's information to the info string info += day.Date.ToLongDateString() + "\n"; } } // Display the information MessageBox.Show( info, "AfterSelectedDateRangeChange", MessageBoxButtons.OK ); }
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