Is there a way to prevent the SelectedDateRanges from clearing when the control is openend again?
Now when I select a number of dates I can get them from the SelectedDateRanges, but when I open the control again, to see if the dates are still selected, the control seems to clear the dates I had previously selected.
That control parses the contents of its edit portion and synchronizes the dropdown's contents so that it reflects the same value, so it deselects any other selected dates in order to do this.
Is it possible to have a range of dates in the edit portion of the control? That would solve the problem as well.
I got it to work by using the following code:
---------
Private Property DateRanges() As List(Of Date)
Private Sub fromUltraCalendarCombo_AfterCloseUp(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fromUltraCalendarCombo.AfterCloseUp If fromUltraCalendarCombo.CalendarInfo IsNot Nothing Then If DateRanges Is Nothing Then DateRanges = New List(Of Date) DateRanges.Clear() If UltraCalendarInfo1.SelectedDateRanges.Count > 0 Then For Each dr As Infragistics.Win.UltraWinSchedule.DateRange In UltraCalendarInfo1.SelectedDateRanges For Each d As Infragistics.Win.UltraWinSchedule.Day In dr.Days DateRanges.Add(d.Date) Next Next fromUltraCalendarCombo.Value = DateRanges(0) End If End If End Sub Private Sub fromUltraCalendarCombo_AfterDropDown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fromUltraCalendarCombo.AfterDropDown If DateRanges IsNot Nothing AndAlso DateRanges.Count > 0 Then UltraCalendarInfo1.SelectedDateRanges.Clear() For i As Integer = 0 To DateRanges.Count - 1 UltraCalendarInfo1.SelectedDateRanges.Add(DateRanges(i)) Next For Each r As Infragistics.Win.UltraWinSchedule.DateRange In UltraCalendarInfo1.SelectedDateRanges For Each d As Infragistics.Win.UltraWinSchedule.Day In r.Days d.Selected = True Next Next fromUltraCalendarCombo.Value = DateRanges(0) End If End Sub
This solution works for me.
No, UltraCalendarCombo does not support that behavior. It was designed to emulate the calendar dropdowns seen in MS Outlook.