To reproduce: 1. Add a RadScheduler on a form and set the culture: this.radScheduler1.Culture = new System.Globalization.CultureInfo("fa-IR"); 2. In regional settings set the Format to Persian(Iran) as it is illustrated in the attached screenshot. 3. Run the application and try to add an appointment. Open the Recurrence dialog and you will get the exception.
Please refer to the attached sample project and gif file. Workaround: this.radScheduler1.ElementProvider = new CustomSchedulerElementProvider(this.radScheduler1); public class CustomSchedulerElementProvider : SchedulerElementProvider { public CustomSchedulerElementProvider(RadScheduler scheduler) : base(scheduler) { } protected override T CreateElement<T>(SchedulerView view, object context) { if (typeof(T) == typeof(TimelineGroupingByResourcesElement)) { return new CustomTimelineGroupingByResourcesElement(this.Scheduler,view)as T; } return base.CreateElement<T>(view, context); } } public class CustomTimelineGroupingByResourcesElement : TimelineGroupingByResourcesElement { public CustomTimelineGroupingByResourcesElement(RadScheduler scheduler, SchedulerView view) : base(scheduler, view) { } protected override SizeF ArrangeOverride(SizeF finalSize) { RectangleF contentRect = new RectangleF(PointF.Empty, finalSize); int vScrollOffset = this.View.AllowResourcesScrolling ? this.ResourceScrollBarThickness : 0; if (this.VScrollBar != null && this.VScrollBar.Maximum < this.VScrollBar.LargeChange) { vScrollOffset = 0; } IList<SchedulerTimelineViewElement> timelineElements = this.GetChildViewElements(); IList<LightVisualElement> viewSeparators = this.GetViewSeparators(); List<RectangleF> resourcesBounds = new List<RectangleF>(); List<RectangleF> separatorsBounds = new List<RectangleF>(); int scrollBarOffset = 0; if (timelineElements.Count > 0) { if (timelineElements[timelineElements.Count - 1].NavigationElement.Visibility == ElementVisibility.Visible) { scrollBarOffset = 17; } } int headerHeight = 0; if (timelineElements.Count > 0 && timelineElements[0].Header.Visibility != ElementVisibility.Collapsed) { headerHeight = timelineElements[0].ViewHeaderHeight + timelineElements[0].ColumnHeaderHeight; } FieldInfo fi = typeof(TimelineGroupingByResourcesElement).GetField("leftCell", BindingFlags.Instance | BindingFlags.NonPublic); SchedulerCellElement leftCell = fi.GetValue(this) as SchedulerCellElement; FieldInfo fi2 = typeof(TimelineGroupingByResourcesElement).GetField("bottomCell", BindingFlags.Instance | BindingFlags.NonPublic); SchedulerCellElement bottomCell = fi2.GetValue(this) as SchedulerCellElement; if (leftCell != null) { RectangleF arrangeRectangle = new RectangleF(0, 0, ResourceHeaderWidth, headerHeight); if (this.RightToLeft) { arrangeRectangle = LayoutUtils.RTLTranslateNonRelative(arrangeRectangle, contentRect); } leftCell.Arrange(arrangeRectangle); } if (bottomCell != null) { RectangleF arrangeRectangle = new RectangleF(0, finalSize.Height - scrollBarOffset, ResourceHeaderWidth, scrollBarOffset); if (this.RightToLeft) { arrangeRectangle = LayoutUtils.RTLTranslateNonRelative(arrangeRectangle, contentRect); } bottomCell.Arrange(arrangeRectangle); } float separatorsWidth = this.View.GroupSeparatorWidth * (this.View.ResourcesPerView - 1); float resourcesHeight = finalSize.Height - separatorsWidth - headerHeight ; float y = 0; for (int i = 0; i < timelineElements.Count; i++) { SchedulerTimelineViewElement timelineElement = timelineElements[i]; LightVisualElement separator = i < viewSeparators.Count ? viewSeparators[i] : null; if (timelineElement != null) { float calculatedHeight = this.GetResourceSize(i, resourcesHeight); RectangleF arrangeRect = new RectangleF(this.ResourceHeaderWidth, y, finalSize.Width - this.ResourceHeaderWidth - vScrollOffset, calculatedHeight); if (i == 0) { arrangeRect.Height += headerHeight; } else if (i == timelineElements.Count - 1) { arrangeRect.Height = finalSize.Height - arrangeRect.Top - 1; } if (this.RightToLeft) { arrangeRect = LayoutUtils.RTLTranslateNonRelative(arrangeRect, contentRect); } timelineElement.Arrange(arrangeRect); y += arrangeRect.Height; if (i == 0) { arrangeRect.Height -= headerHeight; } else { arrangeRect.Y -= headerHeight; } resourcesBounds.Add(arrangeRect); } if (separator != null) { float calculatedHeight = this.View.GroupSeparatorWidth; RectangleF arrangeRect = new RectangleF(this.ResourceHeaderWidth, y, finalSize.Width - this.ResourceHeaderWidth - vScrollOffset, calculatedHeight); if (this.RightToLeft) { arrangeRect = LayoutUtils.RTLTranslateNonRelative(arrangeRect, contentRect); } separator.Arrange(arrangeRect); arrangeRect.Y -= headerHeight; separatorsBounds.Add(arrangeRect); y += calculatedHeight; } } if (this.ResourcesHeader != null) { RectangleF arrangeRectangle = new RectangleF(0, headerHeight, this.ResourceHeaderWidth, finalSize.Height - scrollBarOffset - headerHeight); if (this.RightToLeft) { arrangeRectangle = LayoutUtils.RTLTranslateNonRelative(arrangeRectangle, contentRect); } this.ResourcesHeader.SetResourcesLayoutInfo(resourcesBounds, separatorsBounds); this.ResourcesHeader.Arrange(arrangeRectangle); } if (this.View.AllowResourcesScrolling) { RectangleF scrollbarRect = new RectangleF(finalSize.Width - vScrollOffset, 0, vScrollOffset, finalSize.Height - scrollBarOffset); if (this.RightToLeft) { scrollbarRect = LayoutUtils.RTLTranslateNonRelative(scrollbarRect, contentRect); } this.VScrollBar.Arrange(scrollbarRect); } else { this.VScrollBar.Arrange(RectangleF.Empty); } return finalSize; } }
To reproduce: Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim dayView As SchedulerDayView = Me.RadScheduler1.GetDayView() dayView.RangeFactor = ScaleRange.FiveMinutes Dim ruler As RulerPrimitive = TryCast(Me.RadScheduler1.SchedulerElement.ViewElement, _ SchedulerDayViewElement).DataAreaElement.Ruler ruler.FormatStrings = New RulerFormatStrings("hh", "mm", "hh", "mm") End Sub Add a RadScheduler to a form and use the code snippet above. Run the application and scroll to the current time to see the current time indicator. Leave the form opened so you can see it on the second monitor but focus on another application for 5 minutes. You will notice that the current time indicator won't be redrawn until you focus RadScheduler again, click on the view or perform scrolling. The expected behavior is that RadScheduler will move the current time indicator as time is ticking. Workaround: use a timer to refresh RadScheduler at a certain interval: Dim timer As New Timer timer.Interval = 1000 AddHandler timer.Tick, AddressOf TimerTick timer.Start() Private Sub TimerTick(sender As Object, e As EventArgs) Me.RadScheduler1.SchedulerElement.RefreshViewElement() End Sub
To reproduce: please refer to the attached sample project and gif file illustrating the visual problem. Workaround: subscribe to the RadSchedulerNavigator.ShowWeekendStateChanged event and refresh the scheduler view element: AddHandler Me.RadSchedulerNavigator1.ShowWeekendStateChanged, AddressOf ShowWeekendStateChanged Private Sub ShowWeekendStateChanged(sender As Object, args As StateChangedEventArgs) Me.RadScheduler1.SchedulerElement.RefreshViewElement() End Sub
How to reproduce: Public Class Form1 Sub New() InitializeComponent() End Sub Protected Overrides Sub OnLoad(e As EventArgs) MyBase.OnLoad(e) Me.SetUpScheduler() For i As Integer = 0 To 0 Dim app As New Appointment(DateTime.Now.AddHours(1), TimeSpan.FromMinutes(60), "Summary" & i, "Description1") app.ResourceId = Me.RadScheduler1.Resources(i).Id Me.RadScheduler1.Appointments.Add(app) Dim app2 As New Appointment(DateTime.Now.AddHours(3), TimeSpan.FromMinutes(60), "Summary" & i, "Description2") app2.BackgroundId = 2 app2.ResourceId = Me.RadScheduler1.Resources(i).Id Me.RadScheduler1.Appointments.Add(app2) Dim recurringAppointment As New Appointment(DateTime.Now, TimeSpan.FromMinutes(60), "Recurring" & i, "Recurring Appointment") recurringAppointment.BackgroundId = 4 recurringAppointment.ResourceId = Me.RadScheduler1.Resources(i).Id recurringAppointment.RecurrenceRule = New DailyRecurrenceRule(DateTime.Now, 1, 10) Me.RadScheduler1.Appointments.Add(recurringAppointment) Next 'AddHandler Me.RadScheduler1.CellPrintElementFormatting, AddressOf RadScheduler1_CellPrintElementFormatting End Sub Private Sub SetUpScheduler() Dim colors As Color() = New Color() {Color.LightBlue, Color.LightGreen, Color.LightYellow, Color.Red, Color.Orange, Color.Pink, _ Color.Purple, Color.Peru, Color.PowderBlue} 'Dim names As String() = New String() {"Alan Smith", "Anne Dodsworth", "Boyan Mastoni", "Richard Duncan", "Maria Schneider"} Dim names As String() = New String() {"Rick Astley"} For i As Integer = 0 To names.Length - 1 Dim resource As New Resource() resource.Id = New EventId(i) resource.Name = names(i) resource.Color = colors(i) Me.RadScheduler1.Resources.Add(resource) Next Me.RadScheduler1.ActiveView.ResourcesPerView = 1 Me.RadScheduler1.GroupType = GroupType.Resource Me.RadSchedulerNavigator1.SchedulerNavigatorElement.TimeZonesElementLayout.Visibility = ElementVisibility.Collapsed Me.RadSchedulerNavigator1.ShowWeekendCheckBox.Visibility = ElementVisibility.Collapsed Me.RadSchedulerNavigator1.SchedulerNavigatorElement.MonthViewButton.Visibility = ElementVisibility.Collapsed Me.RadSchedulerNavigator1.SchedulerNavigatorElement.TimelineViewButtonVisible = False End Sub Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click Me.PrintScheduler(Me.RadScheduler1) End Sub Private Sub PrintScheduler(radScheduler As RadScheduler) Dim doc As RadPrintDocument = New RadPrintDocument doc.AssociatedObject = radScheduler Dim schedulerPrintStyle As Telerik.WinControls.UI.SchedulerPrintStyle = Nothing Select Case Me.RadScheduler1.ActiveViewType Case SchedulerViewType.Day schedulerPrintStyle = New SchedulerDailyPrintStyle() 'schedulerPrintStyle = New CustomRadSchedulerDailyPrintStyle() Case SchedulerViewType.Week, SchedulerViewType.WorkWeek schedulerPrintStyle = New SchedulerWeeklyCalendarPrintStyle() 'schedulerPrintStyle = New CustomSchedulerWeeklyCalendarPrintStyle() End Select schedulerPrintStyle.DateStartRange = radScheduler.ActiveView.StartDate schedulerPrintStyle.DateEndRange = radScheduler.ActiveView.EndDate schedulerPrintStyle.TimeStartRange = TimeSpan.FromMinutes(5) schedulerPrintStyle.TimeEndRange = TimeSpan.FromHours(23).Add(TimeSpan.FromMinutes(59)) schedulerPrintStyle.AppointmentFont = New Font("Consolas", 8.5) schedulerPrintStyle.GroupType = SchedulerPrintGroupType.Resource AddHandler schedulerPrintStyle.CellElementFormatting, AddressOf radSchedWork_PrintSchedulerCellElementFormatting radScheduler.PrintStyle = schedulerPrintStyle radScheduler.PrintPreview() End Sub Private Sub radSchedWork_PrintSchedulerCellElementFormatting(sender As Object, e As PrintSchedulerCellEventArgs) e.CellElement.BackColor = Color.White e.CellElement.DrawFill = False Dim cell As SchedulerPrintCellElement = TryCast(e.CellElement, SchedulerPrintCellElement) If cell IsNot Nothing Then Dim msg As String = "PrintSchedulerCellElementFormatting for Date {0}" Debug.Print(String.Format(msg, e.CellElement.Date)) 'If cell.DateFormat = "hh:mm" Then ' cell.DateFormat = "hh:mm tt" 'ElseIf cell.DateFormat = "dd MMM" Then ' cell.DateFormat = "dd ddd" 'Else e.CellElement.DrawFill = True If e.CellElement.[Date].Hour Mod 2 = 0 Then If e.CellElement.[Date].Day Mod 2 = 0 Then e.CellElement.BackColor = Color.LightSalmon Else e.CellElement.BackColor = Color.LightBlue End If Else e.CellElement.BackColor = Color.LightGreen End If 'End If End If End Sub Private Sub RadScheduler1_CellFormatting(sender As Object, e As SchedulerCellEventArgs) Handles RadScheduler1.CellFormatting 'reset all properties for cells that may be changed here e.CellElement.BackColor = Color.White e.CellElement.DrawFill = False If e.CellElement.[Date].Hour Mod 2 = 0 Then e.CellElement.DrawFill = True If e.CellElement.[Date].Day Mod 2 = 0 Then e.CellElement.BackColor = Color.LightSalmon Else e.CellElement.BackColor = Color.LightBlue End If Else e.CellElement.BackColor = Color.LightGreen End If End Sub End Class Workaround: Private Sub PrintScheduler(radScheduler As RadScheduler) Dim doc As RadPrintDocument = New RadPrintDocument doc.AssociatedObject = radScheduler Dim schedulerPrintStyle As Telerik.WinControls.UI.SchedulerPrintStyle = Nothing Select Case Me.RadScheduler1.ActiveViewType Case SchedulerViewType.Day 'schedulerPrintStyle = New SchedulerDailyPrintStyle() schedulerPrintStyle = New CustomRadSchedulerDailyPrintStyle() Case SchedulerViewType.Week, SchedulerViewType.WorkWeek 'schedulerPrintStyle = New SchedulerWeeklyCalendarPrintStyle() schedulerPrintStyle = New CustomSchedulerWeeklyCalendarPrintStyle() End Select schedulerPrintStyle.DateStartRange = radScheduler.ActiveView.StartDate schedulerPrintStyle.DateEndRange = radScheduler.ActiveView.EndDate schedulerPrintStyle.TimeStartRange = TimeSpan.FromMinutes(5) schedulerPrintStyle.TimeEndRange = TimeSpan.FromHours(23).Add(TimeSpan.FromMinutes(59)) schedulerPrintStyle.AppointmentFont = New Font("Consolas", 8.5) schedulerPrintStyle.GroupType = SchedulerPrintGroupType.Resource AddHandler schedulerPrintStyle.CellElementFormatting, AddressOf radSchedWork_PrintSchedulerCellElementFormatting radScheduler.PrintStyle = schedulerPrintStyle radScheduler.PrintPreview() End Sub Public Class CustomRadSchedulerDailyPrintStyle Inherits SchedulerDailyPrintStyle Private currentPage As Integer Public Overrides Sub DrawPage(graphics As Graphics, drawingArea As Rectangle, pageNumber As Integer) Me.currentPage = pageNumber MyBase.DrawPage(graphics, drawingArea, pageNumber) End Sub Protected Overrides Sub DrawCells(appArea As Rectangle, graphics As Graphics) Dim currentDate = Me.GetPageDate(Me.currentPage) Dim rowCount As Single = Math.Max(1, CInt(Math.Ceiling((TimeEndRange - TimeSpan.FromHours(TimeStartRange.Hours)).TotalHours))) Dim rowHeight As Single = CSng(appArea.Height) / rowCount For row As Integer = 0 To rowCount - 1 Dim headerCellRect As New RectangleF(appArea.X, appArea.Y + row * rowHeight, Me.HoursColumnWidth, rowHeight) Dim element As New SchedulerPrintCellElement() element.DrawBorder = True element.Font = Me.DateHeadingFont element.[Date] = currentDate.AddHours(CInt(TimeStartRange.Add(TimeSpan.FromHours(row)).TotalHours)) element.DateFormat = "hh:mm" element.TextAlignment = ContentAlignment.TopRight Me.DrawCell(element, graphics, headerCellRect) element.DrawText = False Dim numberOfSubRows As Integer = 1 If Me.Scheduler.ActiveViewType = SchedulerViewType.Day OrElse Me.Scheduler.ActiveViewType = SchedulerViewType.MultiDay OrElse Me.Scheduler.ActiveViewType = SchedulerViewType.Week OrElse Me.Scheduler.ActiveViewType = SchedulerViewType.WorkWeek Then numberOfSubRows = 60 / CInt(DirectCast(Me.Scheduler.ActiveView, SchedulerDayViewBase).RangeFactor) End If For i As Integer = 0 To numberOfSubRows - 1 Dim rect As New RectangleF(appArea.X + HoursColumnWidth, appArea.Y + row * rowHeight + rowHeight / numberOfSubRows * i, appArea.Width - HoursColumnWidth, rowHeight / numberOfSubRows) If i = numberOfSubRows - 1 Then rect.Height += (appArea.Y + (row + 1) * rowHeight) - (rect.Y + rect.Height) End If Me.DrawCell(element, graphics, rect) Next Next End Sub End Class Public Class CustomSchedulerWeeklyCalendarPrintStyle Inherits SchedulerWeeklyCalendarPrintStyle Protected Overrides Sub DrawCells(appArea As RectangleF, graphics As Graphics, pageNumber As Integer) Dim days As Integer = Me.GetNumberOfDays(pageNumber) Dim currentDate As DateTime = Me.GetPageDate(pageNumber) If Me.TwoPagesPerWeek AndAlso pageNumber Mod 2 = 0 Then 'page numbers are 1-based currentDate = currentDate.AddDays(Me.GetNumberOfDays(pageNumber - 1)) End If Dim rowCount As Single = Math.Max(1, CInt(Math.Ceiling((TimeEndRange - TimeSpan.FromHours(TimeStartRange.Hours)).TotalHours))) Dim rowHeight As Single = CSng(appArea.Height) / rowCount Dim columnWidth As Single = (appArea.Width - Me.HoursColumnWidth) / CSng(days) For row As Integer = 0 To rowCount - 1 Dim headerCellRect As New RectangleF(appArea.X, appArea.Y + row * rowHeight, Me.HoursColumnWidth, rowHeight) Dim element As New SchedulerPrintCellElement() element.DrawBorder = True element.Font = Me.DateHeadingFont element.[Date] = DateTime.Today.AddHours(CInt(TimeStartRange.Add(TimeSpan.FromHours(row)).TotalHours)) element.[Date] = currentDate.AddHours(CInt(TimeStartRange.Add(TimeSpan.FromHours(row)).TotalHours)) element.DateFormat = "hh:mm" element.TextAlignment = ContentAlignment.TopRight Me.DrawCell(element, graphics, headerCellRect) element.DrawText = False Dim numberOfSubRows As Integer = 60 / CInt(DirectCast(Me.Scheduler.ActiveView, SchedulerDayViewBase).RangeFactor) For i As Integer = 0 To numberOfSubRows - 1 Dim rect As New RectangleF(appArea.X + HoursColumnWidth, appArea.Y + row * rowHeight + rowHeight / numberOfSubRows * i, appArea.Width - HoursColumnWidth, rowHeight / numberOfSubRows) If i = numberOfSubRows - 1 Then rect.Height += (appArea.Y + (row + 1) * rowHeight) - (rect.Y + rect.Height) End If Me.DrawCell(element, graphics, rect) Next For j As Integer = 0 To days - 1 element = New SchedulerPrintCellElement() element.DrawBorder = True element.DrawText = False element.[Date] = currentDate.AddDays(j).AddHours(CInt(TimeStartRange.Add(TimeSpan.FromHours(row)).TotalHours)) Dim rect As New RectangleF(appArea.X + HoursColumnWidth + j * columnWidth, appArea.Y + row * rowHeight, columnWidth, rowHeight) Me.DrawCell(element, graphics, rect) Next Next End Sub End Class
When you create an appointment that starts on 30 November and ends at 00:00 on 1 December, the appointment time slot is extended to the next day. This happens when it is the end of the previous month and the beginning of the next one. Please refer to the attached sample gif file illustrating how to reproduce the problem with the Demo Application. Workaround: if the end time is at midnight, reduce the duration with one minute. private void radScheduler1_AppointmentAdded(object sender, Telerik.WinControls.UI.AppointmentAddedEventArgs e) { if (e.Appointment.End.Hour==0 && e.Appointment.End.Minute==0) { e.Appointment.End = e.Appointment.End.AddMinutes(-1); } }
Broken in version R3 2016 (2016.3.913) How to reproduce: SchedulerDayViewElement dayViewElement = (SchedulerDayViewElement)this.radScheduler1.ViewElement; dayViewElement.SetColumnWidth(1, 2); Workaround: IDictionary cachedSum = (IDictionary)dayViewElement.GetType().GetField("cachedSum", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(dayViewElement); cachedSum.Clear(); IDictionary cachedColumnHorizontalOffset = (IDictionary)dayViewElement.GetType().GetField("cachedColumnHorizontalOffset", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(dayViewElement); cachedColumnHorizontalOffset.Clear(); SchedulerDayViewElement dayViewElement = (SchedulerDayViewElement)this.radScheduler1.ViewElement; dayViewElement.SetColumnWidth(1, 2);
1. Add RadSchedulerNavigator and a RadScheduler. Change the view type to Week View. 2. Associate the RadSchedulerNavigator to RadScheduler. Change the PC's time zone to (UTC-03:00) Brasilia Time zone 3. Change the PC's date to 21 Oct 2016 and run the application. 4. When you change the time zone in RadSchedulerNavigator to (UTC-03:00) Brasilia Time zone, you will notice that the ruler starts from 23. Workaround: public Form1() { InitializeComponent(); radSchedulerNavigator1.AssociatedScheduler = radScheduler1; this.radScheduler1.ActiveViewChanged += radScheduler1_ActiveViewChanged; this.radScheduler1.CellElementMouseDown += radScheduler1_CellElementMouseDown; this.radScheduler1.AppointmentEditDialogShowing += radScheduler1_AppointmentEditDialogShowing; radScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Week; } DateTime? date = null; private void radScheduler1_CellElementMouseDown(object sender, MouseEventArgs e) { SchedulerCellElement cell = this.radScheduler1.ElementTree.GetElementAtPoint(e.Location) as SchedulerCellElement; if (cell != null) { date = cell.Date; } } CustomEditAppointmentDialog dialog = null; private void radScheduler1_AppointmentEditDialogShowing(object sender, AppointmentEditDialogShowingEventArgs e) { if (dialog == null) { dialog = new CustomEditAppointmentDialog(); } e.AppointmentEditDialog = dialog; if (date != null && !e.Appointment.Start.Equals(date)) { e.Appointment.Start = (DateTime)date; } date = null; } private void radScheduler1_ActiveViewChanged(object sender, Telerik.WinControls.UI.SchedulerViewChangedEventArgs e) { SchedulerDayView dayView = e.NewView as SchedulerDayView; SchedulerWeekView weekView = e.NewView as SchedulerWeekView; if (dayView != null || weekView != null) { RulerPrimitive ruler = (this.radScheduler1.SchedulerElement.ViewElement as SchedulerDayViewElement).DataAreaElement.Ruler; ruler.GetType().GetField("defaultOffset", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(ruler, 0.0f); } } public class CustomEditAppointmentDialog : EditAppointmentDialog { protected override void LoadSettingsFromEvent(IEvent sourceEvent) { base.LoadSettingsFromEvent(sourceEvent); this.dateStart.Value = sourceEvent.Start; this.timeStart.Value = sourceEvent.Start; } }
Workaround: Sub New() InitializeComponent() Me.RadScheduler1.ActiveViewType = UI.SchedulerViewType.Week AddHandler Me.RadSchedulerNavigator1.SchedulerNavigatorElement.ShowWeekendCheckBox.ToggleStateChanged, AddressOf ToggleStateChanged End Sub Private Sub ToggleStateChanged(sender As Object, args As UI.StateChangedEventArgs) Me.RadScheduler1.SchedulerElement.RefreshViewElement() End Sub
To reproduce: public Form1() { InitializeComponent(); this.radScheduler1.ActiveViewType = SchedulerViewType.Month; Appointment appointment = new Appointment(DateTime.Today.AddHours(23).AddMinutes(45), new TimeSpan(0,15,0), "Meeting"); DailyRecurrenceRule rrule = new DailyRecurrenceRule(appointment.Start, 1, 10); appointment.RecurrenceRule = rrule; this.radScheduler1.Appointments.Add(appointment); this.radScheduler1.EnableExactTimeRendering = true; } Click "This month" in RadSchedulerNavigator. Workaround: In order to deal with the border case with appointment ending at 00:00h, use a new TimeSpan(0,14,59)
To reproduce: public Form1() { InitializeComponent(); this.radScheduler1.ActiveViewType = SchedulerViewType.Week; SchedulerWeekView weekView = this.radScheduler1.GetWeekView(); weekView.RangeFactor = ScaleRange.QuarterHour; Appointment appointment = new Appointment(DateTime.Today.AddHours(23).AddMinutes(45), new TimeSpan(0,15,0), "Meeting"); this.radScheduler1.Appointments.Add(appointment); } private void radCheckBox1_ToggleStateChanged(object sender, Telerik.WinControls.UI.StateChangedEventArgs args) { this.radScheduler1.EnableExactTimeRendering = this.radCheckBox1.Checked; } Please refer to the attached gif file. Workaround: In order to deal with the border case with appointment ending at 00:00h, use a new TimeSpan(0,14,59)
To reproduce: public Form1() { InitializeComponent(); this.radScheduler1.ActiveViewType = SchedulerViewType.Day; RulerPrimitive ruler = (this.radScheduler1.SchedulerElement.ViewElement as SchedulerDayViewElement).DataAreaElement.Ruler; ruler.RangeFactor= ScaleRange.TenMinutes; } Workaround: this.radScheduler1.GetDayView().RangeFactor = ScaleRange.TenMinutes;
To reproduce: public Form1() { InitializeComponent(); this.radScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Month; CultureInfo culture = new CultureInfo("en-US"); culture.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Monday; this.radScheduler1.Culture = culture; Appointment a = new Appointment(new DateTime(2016, 8, 29, 0, 0, 0), new DateTime(2016, 9, 5, 0, 0, 0), "Meeting"); this.radScheduler1.Appointments.Add(a); this.radScheduler1.FocusedDate = new DateTime(2016, 9, 1); this.radScheduler1.EnableExactTimeRendering = true; } When you run the application starting scrolling with the mouse wheel up/down. Workaround: do not set the FirstDayOfWeek to Monday.
To reproduce: Sub New() InitializeComponent() Dim colors() As Color = {Color.LightBlue, Color.LightGreen, Color.LightYellow, Color.Red, _ Color.Orange, Color.Pink, Color.Purple, Color.Peru, Color.PowderBlue} Dim names() As String = {"Alan Smith", "Anne Dodsworth", "Boyan Mastoni", "Richard Duncan", "Maria Shnaider"} For i As Integer = 0 To names.Length - 1 Dim resource As New Telerik.WinControls.UI.Resource() resource.Id = New EventId(i) resource.Name = names(i) resource.Color = colors(i) Me.RadScheduler1.Resources.Add(resource) Next i Me.RadScheduler1.GroupType = GroupType.Resource Me.RadScheduler1.ActiveView.ResourcesPerView = Me.RadScheduler1.Resources.Count Me.RadScheduler1.ActiveViewType = SchedulerViewType.Timeline Dim rand As New Random For index = 1 To 20 Dim a As New Appointment(DateTime.Now.AddDays(index), TimeSpan.FromHours(2), "A" & index) a.ResourceId = Me.RadScheduler1.Resources(rand.Next(0, Me.RadScheduler1.Resources.Count)).Id Me.RadScheduler1.Appointments.Add(a) Next Dim timelineView As SchedulerTimelineView = Me.RadScheduler1.GetTimelineView() Dim oneMinute As New OneMinuteTimescale() timelineView.SchedulerTimescales.Add(oneMinute) oneMinute.Visible = True End Sub Public Class OneMinuteTimescale Inherits MinutesTimescale Public Overrides ReadOnly Property Name As String Get Return "OneMinuteTimescale" End Get End Property Public Overrides ReadOnly Property ScalingFactor() As Integer Get Return 1 End Get End Property End Class Workaround: decrease the range: timelineView.RangeStartDate = DateTime.Today timelineView.RangeEndDate = timelineView.RangeStartDate.AddDays(1)
To reproduce: Resource lResource; var LColors = new Color[5]; SchedulerMultiDayView multyDayView; DateTime startDate; int interval; radScheduler1.Statuses.Add(new AppointmentStatusInfo(5, "New", Color.Green, Color.Green, AppointmentStatusFillType.Solid)); radScheduler1.Statuses.Add(new AppointmentStatusInfo(6, "ACCP", Color.DarkOrange, Color.DarkOrange, AppointmentStatusFillType.Solid)); lResource = new Resource(); lResource.Id = new EventId(1); lResource.Name = "Bert"; lResource.Color = Color.Red; radScheduler1.Resources.Add(lResource); radScheduler1.ActiveView.ShowHeader = true; this.radScheduler1.ActiveViewType = SchedulerViewType.MultiDay; multyDayView = this.radScheduler1.GetMultiDayView(); startDate = DateTime.Today; interval = 30; radScheduler1.GroupType = GroupType.Resource; multyDayView.Intervals.Add(startDate, interval); multyDayView.RulerScaleSize = 4; radScheduler1.EnableExactTimeRendering = true; multyDayView.RangeFactor = ScaleRange.Hour;
Please refer to the attached gif file.
public Form1() { InitializeComponent(); DateTime d = DateTime.Now.Date; radScheduler1.Appointments.Add(new Appointment(new DateTime(d.Year, d.Month, d.Day, 1, 30, 0), new DateTime(d.Year, d.Month, d.Day, 1, 30, 0), "Appointment_Free_0", "", "")); radScheduler1.Appointments.Add(new Appointment(new DateTime(d.Year, d.Month, d.Day, 8, 30, 0), new DateTime(d.Year, d.Month, d.Day, 9, 0, 0), "Appointment_Free_0", "", "")); radScheduler1.Appointments.Add(new Appointment(new DateTime(d.Year, d.Month, d.Day, 11, 00, 0), new DateTime(d.Year, d.Month, d.Day, 11, 30, 0), "Appointment_Free_0", "", "")); radScheduler1.Appointments.Add(new Appointment(new DateTime(d.Year, d.Month, d.Day, 11, 0, 0), new DateTime(d.Year, d.Month, d.Day, 11, 0, 0), "Appointment_Free_0", "", "")); radScheduler1.Appointments.Add(new Appointment(new DateTime(d.Year, d.Month, d.Day, 10, 30, 0), new DateTime(d.Year, d.Month, d.Day, 11, 0, 0), "Appointment_Free_0", "", "")); radScheduler1.Appointments.Add(new Appointment(new DateTime(d.Year, d.Month, d.Day, 11, 00, 0), new DateTime(d.Year, d.Month, d.Day, 11, 30, 0), "Appointment_Free_0", "", "")); radScheduler1.Appointments.Add(new Appointment(new DateTime(d.Year, d.Month, d.Day, 11, 30, 0), new DateTime(d.Year, d.Month, d.Day, 12, 0, 0), "Appointment_Free_0", "", "")); radScheduler1.Appointments.Add(new Appointment(new DateTime(d.Year, d.Month, d.Day, 14, 0, 0), new DateTime(d.Year, d.Month, d.Day, 14, 30, 0), "Appointment_Free_0", "", "")); radScheduler1.Appointments.Add(new Appointment(new DateTime(d.Year, d.Month, d.Day, 15, 00, 0), new DateTime(d.Year, d.Month, d.Day, 15, 30, 0), "Appointment_Free_0", "", "")); radScheduler1.Appointments.Add(new Appointment(new DateTime(d.Year, d.Month, d.Day, 17, 30, 0), new DateTime(d.Year, d.Month, d.Day, 17, 30, 0), "Appointment_Free_0", "", "")); radScheduler1.ActiveViewType = SchedulerViewType.Day; radScheduler1.EnableExactTimeRendering = true; } Workaround: use a custom DayViewAppointmentsTable this.radScheduler1.ElementProvider = new MyElementProvider(this.radScheduler1); public class MyElementProvider : SchedulerElementProvider { public MyElementProvider(RadScheduler scheduler) : base(scheduler) { } protected override T CreateElement<T>(SchedulerView view, object context) { if (typeof(T) == typeof(DayViewAppointmentsTable)) { return new CustomDayViewAppointmentsTable(view.Scheduler, view, (DayViewAppointmentsArea)context)as T; } return base.CreateElement<T>(view, context); } } public class CustomDayViewAppointmentsTable : DayViewAppointmentsTable { public CustomDayViewAppointmentsTable(RadScheduler scheduler, SchedulerView view, DayViewAppointmentsArea area) : base(scheduler, view, area) { } protected override IEnumerable<AppointmentElement> CreateAppointmentElements() { if (this.View != null) { IList<IEvent> appointmentsInView = new List<IEvent>(this.View.Appointments); List<AppointmentElement> elements = DivideAppointmentToElements(appointmentsInView); elements.Sort(0, elements.Count, new DateTimeComparer(this.Scheduler)); foreach (AppointmentElement currentAppointment in elements) { currentAppointment.RelatedAppointments.Clear(); currentAppointment.DesiredBounds = new RectangleF(); } foreach (AppointmentElement appointment in elements) { List<AppointmentElement> intersectingAppointments = this.GetAllAppointmentsInDay(appointment.Start.Day, elements); intersectingAppointments.Remove(appointment); appointment.RelatedAppointments = intersectingAppointments; } return elements; } else { return new List<AppointmentElement>(); } } private List<AppointmentElement> GetAllAppointmentsInDay(int day, List<AppointmentElement> elements) { List<AppointmentElement> result = new List<AppointmentElement>(); foreach (AppointmentElement appointment in elements) { if (appointment.Start.Day == day) { result.Add(appointment); } } return result; } private List<AppointmentElement> DivideAppointmentToElements(IList<IEvent> appointmentsInView) { List<AppointmentElement> childAppointments = new List<AppointmentElement>(); TimeSpan startTime = TimeSpan.FromMinutes(this.GetDayViewBase().RulerStartScale * 60 + this.GetDayViewBase().RulerStartScaleMinutes); TimeSpan endTime = TimeSpan.FromMinutes(this.GetDayViewBase().RulerEndScale * 60 + this.GetDayViewBase().RulerEndScaleMinutes); foreach (IEvent app in appointmentsInView) { SchedulerDayViewBase dayView = this.GetDayViewBase(); bool allDay = (dayView != null) ? dayView.IsAllDayEvent(app) : false; DateTime appStart = this.View.DefaultTimeZone.OffsetTime(app.Start, this.Scheduler.SystemTimeZone); DateTime appEnd = this.View.DefaultTimeZone.OffsetTime(app.End, this.Scheduler.SystemTimeZone); if (!allDay) { // Handle > 1 day appointments if (appStart.Day != appEnd.Day && !(appEnd.Day - appStart.Day == 1 && appEnd.TimeOfDay == TimeSpan.Zero)) { AppointmentElement appointment1 = this.CreateAppointmentElement(this.Scheduler, this.View, app); appointment1.Start = appStart; appointment1.End = DateHelper.GetEndOfDay(appStart); if (appointment1.Start.TimeOfDay >= endTime) { appointment1.Start = new DateTime(appStart.Year, appStart.Month, appStart.Day, 0, 0, 0).Add(endTime).AddMinutes(-(int)this.GetDayViewBase().RangeFactor); } AppointmentElement appointment2 = this.CreateAppointmentElement(this.Scheduler, this.View, app); appointment2.Start = appEnd.Date; appointment2.End = appEnd; if (appointment1.Start >= this.View.StartDate) { childAppointments.Add(appointment1); } if (appointment2.Start >= this.View.StartDate) { childAppointments.Add(appointment2); } } else { AppointmentElement appointment1 = this.CreateAppointmentElement(this.Scheduler, this.View, app); appointment1.Start = appStart; appointment1.End = appEnd; if (appointment1.Start.TimeOfDay < startTime) { appointment1.Start = new DateTime(appStart.Year, appStart.Month, appStart.Day, 0, 0, 0).Add(startTime); } if (appointment1.Start.TimeOfDay >= endTime) { appointment1.Start = new DateTime(appStart.Year, appStart.Month, appStart.Day, 0, 0, 0).Add(endTime).AddMinutes(-(int)this.GetDayViewBase().RangeFactor); } if (appointment1.End.TimeOfDay > endTime) { appointment1.End = new DateTime(appEnd.Year, appEnd.Month, appEnd.Day, 0, 0, 0).Add(endTime); } if (appointment1.End.TimeOfDay <= startTime) { appointment1.End = new DateTime(appEnd.Year, appEnd.Month, appEnd.Day, 0, 0, 0).Add(startTime).AddMinutes((int)this.GetDayViewBase().RangeFactor); } childAppointments.Add(appointment1); } } else if (!dayView.ShowAllDayArea) { DateTimeInterval viewInterval = new DateTimeInterval(this.View.StartDate, DateHelper.GetEndOfDay(this.View.EndDate)); AppointmentElement appointment1 = this.CreateAppointmentElement(this.Scheduler, this.View, app); appointment1.Start = appStart; appointment1.End = DateHelper.GetEndOfDay(appStart); DateTimeInterval interval = new DateTimeInterval(appStart, appointment1.End); if (interval.IntersectsWith(viewInterval)) { if (appointment1.Start.TimeOfDay < startTime) { appointment1.Start = new DateTime(appStart.Year, appStart.Month, appStart.Day, 0, 0, 0).Add(startTime); } if (appointment1.Start.TimeOfDay >= endTime) { appointment1.Start = new DateTime(appStart.Year, appStart.Month, appStart.Day, 0, 0, 0).Add(endTime).AddMinutes(-(int)this.GetDayViewBase().RangeFactor); } if (appointment1.End.TimeOfDay > endTime) { appointment1.End = new DateTime(appEnd.Year, appEnd.Month, appEnd.Day, 0, 0, 0).Add(endTime); } if (appointment1.End.TimeOfDay <= startTime) { appointment1.End = new DateTime(appEnd.Year, appEnd.Month, appEnd.Day, 0, 0, 0).Add(startTime).AddMinutes((int)this.GetDayViewBase().RangeFactor); } childAppointments.Add(appointment1); } DateTime startDate = appStart.AddDays(1).Date; AppointmentElement appointment2 = null; while (startDate <= appEnd.Date.AddDays(-1)) { appointment2 = this.CreateAppointmentElement(this.Scheduler, this.View, app); appointment2.Start = startDate; appointment2.End = DateHelper.GetEndOfDay(startDate); interval = new DateTimeInterval(appointment2.Start, appointment2.End); if (interval.IntersectsWith(viewInterval)) { childAppointments.Add(appointment2); } startDate = startDate.AddDays(1); } DateTime endDate = appEnd.Date; DateTime endAppointmentDate = appEnd; appointment2 = this.CreateAppointmentElement(this.Scheduler, this.View, app); appointment2.Start = endDate; appointment2.End = endAppointmentDate; interval = new DateTimeInterval(endDate, endAppointmentDate); if (interval.IntersectsWith(viewInterval) && interval.Start != appStart) { childAppointments.Add(appointment2); } } } return childAppointments; } private AppointmentElement CreateAppointmentElement(RadScheduler scheduler, SchedulerView view, IEvent appointment) { AppointmentElement appointmentElement = null; if (scheduler.AppointmentElementFactory != null) { appointmentElement = scheduler.AppointmentElementFactory.CreateAppointmentElement(scheduler, view, appointment); } else { appointmentElement = scheduler.ElementProvider.GetElement<AppointmentElement>(view, appointment); } return appointmentElement; } }
To reproduce: follow the steps from the attached gif file. Workaround: public Form1() { InitializeComponent(); this.radScheduler1.RecurrenceEditDialogShowing += radScheduler1_RecurrenceEditDialogShowing; } CustomEditRecurrenceDialog dialog = null; private void radScheduler1_RecurrenceEditDialogShowing(object sender, Telerik.WinControls.UI.RecurrenceEditDialogShowingEventArgs e) { if (dialog == null) { dialog = new CustomEditRecurrenceDialog(e.Appointment); } e.RecurrenceEditDialog = dialog; } public class CustomEditRecurrenceDialog : EditRecurrenceDialog { public CustomEditRecurrenceDialog(IEvent appointment) : base(appointment) { } protected override void ApplyAppointmentDates() { DateTime end = this.appointment.End; base.ApplyAppointmentDates(); this.appointment.End = new DateTime(end.Year, end.Month, end.Day, this.timeEnd.Value.Hour, this.timeEnd.Value.Minute, this.timeEnd.Value.Second); } }