Please refer to the attached sample project. When you start the application the form's text indicates how many times the AppointmentFormatting event is fired for only 30 appointments - more than 400 times. The more appointments you have , the more times the vent is initially fired,e.g. if you have 50 appointmens it is fired If you switch between the different views you will see how the counter increases its value.
Please use the Demo application >> Scheduler example and follow the steps in the attached gif file.
Expected result: the deleted appointment should disappear from the grid after closing the edit dialog.
Actual result: the deleted appointment is still visible in the agenda grid after closing the edit dialog.
Note: pressing the Delete key when an appointment is selected in agenda view doesn't perform any delete operation. In the rest of the scheduler view, the selected appointment is deleted.
Workaround: after an appointment is deleted, refresh the agenda grid by changing the view:
Private Sub RadScheduler1_AppointmentDeleted(sender As Object, e As SchedulerAppointmentEventArgs)
Me.RadScheduler1.ActiveViewType = SchedulerViewType.Day
Me.RadScheduler1.ActiveViewType = SchedulerViewType.Agenda
End Sub
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; } }
Please refer to the attached screenshots. A sample project is attached. There is a known issue in the .NET Framework considering the "fa-IR" culture. Please refer to the following MSDN resource for a solution which is included in the sample project: https://code.msdn.microsoft.com/Fixing-Persian-Locale-for-6e66e044#content Workaround: private void radScheduler1_CellFormatting(object sender, SchedulerCellEventArgs e) { MonthCellElement monthCellElement = e.CellElement as MonthCellElement; if (monthCellElement != null) { monthCellElement.Header.Text = monthCellElement.Date.ToString("dd", this.radScheduler1.Culture); } }
The local time is EEST — Eastern European Summer Time (Current Offset: UTC/GMT +3 hours). Add an additional time zone IST — India Standard Time (Current Offset: UTC/GMT +5:30 hours). It is expected to show 2 hours and 30 minutes difference between the two times zones. However, it is 1 hour and 30 minutes:
Public Sub New()
InitializeComponent()
allTimeZones = SchedulerTimeZone.GetSchedulerTimeZones()
Dim mumbai As SchedulerTimeZone = GetSpecificTimeZone("India Standard Time")
If Not mumbai.Equals(Me.RadScheduler1.GetDayView().DefaultTimeZone) Then
RadScheduler1.GetDayView().TimeZones.Insert(0, mumbai)
End If
Dim utc As SchedulerTimeZone = GetSpecificTimeZone("UTC")
If Not utc.Equals(Me.RadScheduler1.GetDayView().DefaultTimeZone) Then
RadScheduler1.GetDayView().TimeZones.Insert(0, utc)
End If
End Sub
Private Function GetSpecificTimeZone(_TimeZoneInformationID As String) As SchedulerTimeZone
Try
Dim tempZone As New SchedulerTimeZone((From t In allTimeZones.Where(Function(x) x.TimeZoneInformation.Id Like _TimeZoneInformationID) Select t.TimeZoneInformation).First)
tempZone.Label = tempZone.TimeZoneInformation.BaseUtcOffset.ToString()
Return tempZone
Catch ex As Exception
Return Nothing
End Try
End Function
Actual: 1 hour behind the expected
Expected:
Workaround:
Public Class Form1
Private allTimeZones As List(Of SchedulerTimeZone)
Public Sub New()
InitializeComponent()
Me.RadScheduler1.ElementProvider = New CustomSchedulerElementProvider(Me.RadScheduler1)
allTimeZones = SchedulerTimeZone.GetSchedulerTimeZones()
Dim mumbai As SchedulerTimeZone = GetSpecificTimeZone("India Standard Time")
If Not mumbai.Equals(Me.RadScheduler1.GetDayView().DefaultTimeZone) Then
RadScheduler1.GetDayView().TimeZones.Insert(0, mumbai)
End If
Dim utc As SchedulerTimeZone = GetSpecificTimeZone("UTC")
If Not utc.Equals(Me.RadScheduler1.GetDayView().DefaultTimeZone) Then
RadScheduler1.GetDayView().TimeZones.Insert(0, utc)
End If
End Sub
Private Function GetSpecificTimeZone(_TimeZoneInformationID As String) As SchedulerTimeZone
Try
Dim tempZone As New SchedulerTimeZone((From t In allTimeZones.Where(Function(x) x.TimeZoneInformation.Id Like _TimeZoneInformationID) Select t.TimeZoneInformation).First)
tempZone.Label = tempZone.TimeZoneInformation.BaseUtcOffset.ToString()
Return tempZone
Catch ex As Exception
Return Nothing
End Try
End Function
End Class
Public Class CustomSchedulerElementProvider
Inherits SchedulerElementProvider
Public Sub New(scheduler As RadScheduler)
MyBase.New(scheduler)
End Sub
Public Overrides Function CreateRulerPrimitive(area As DayViewAppointmentsArea, timeZone As SchedulerTimeZone) As RulerPrimitive
Dim ruler As RulerPrimitive = MyBase.CreateRulerPrimitive(area, timeZone)
ruler.RulerRenderer = New CustomRulerRenderer(ruler)
Return ruler
End Function
End Class
Public Class CustomRulerRenderer
Inherits RulerRenderer
Public Sub New(ruler As RulerPrimitive)
MyBase.New(ruler)
End Sub
Public Overrides Sub RenderHour(g As IGraphics, hour As Integer, bounds As RectangleF)
hour += Me.ruler.StartScale + CInt(Math.Ceiling(Me.ruler.DefaultOffset))
Dim currentTime As DateTime = DateTime.Now.Date.AddHours(hour)
Dim percent As Single = Me.ruler.DefaultOffset - CSng(Math.Floor(CDbl(Me.ruler.DefaultOffset)))
Dim x As Integer = Me.ruler.HourLineStartPosition
Dim y As Single = CSng(Math.Ceiling(bounds.Top + (GetSpecificRange() * bounds.Height) * percent))
Dim hourText As String = ""
If Me.ruler.FormatStrings.HoursFormatString IsNot Nothing Then
hourText = currentTime.ToString(Me.ruler.FormatStrings.HoursFormatString)
End If
'Dim args As RulerTextFormattingEventArgs = New RulerTextFormattingEventArgs(hourText, RulerTextFormattingContext.Hour, currentTime)
'Me.ruler.Scheduler.OnRulerTextFormatting(args)
'hourText = args.Text
Dim minutesText As String = ""
If Me.ruler.FormatStrings.MinutesFormatString IsNot Nothing Then
minutesText = currentTime.ToString(Me.ruler.FormatStrings.MinutesFormatString)
End If
'args = New RulerTextFormattingEventArgs(minutesText, RulerTextFormattingContext.Minute, currentTime)
'Me.ruler.scheduler.OnRulerTextFormatting(args)
'minutesText = args.Text
Dim measuredSize As Size = TextRenderer.MeasureText(hourText, Me.ruler.Font)
measuredSize = DrawTimeText(g, y, hourText, minutesText, measuredSize)
If ruler.RightToLeft Then
g.DrawLine(Me.ruler.HourLineColor, Me.ruler.Bounds.Left, y, Me.ruler.Bounds.Width - x, y, Me.ruler.DpiScaleFactor.Height)
g.DrawLine(Me.ruler.HourLineShadowColor, Me.ruler.Bounds.Left, y + Me.ruler.DpiScaleFactor.Height, Me.ruler.Bounds.Width - x, y + Me.ruler.DpiScaleFactor.Height, Me.ruler.DpiScaleFactor.Height)
Else
g.DrawLine(Me.ruler.HourLineColor, x, y, Me.ruler.Bounds.Width, y, Me.ruler.DpiScaleFactor.Height)
g.DrawLine(Me.ruler.HourLineShadowColor, x, y + Me.ruler.DpiScaleFactor.Height, Me.ruler.Bounds.Width, y + Me.ruler.DpiScaleFactor.Height, Me.ruler.DpiScaleFactor.Height)
End If
End Sub
Friend Function GetSpecificRange() As Integer
Return 60 / CInt(Me.ruler.RangeFactor)
End Function
End Class
Additional borders appear in AgendaView when the Date column is sorted. This behavior is observed in the following themes:
this.radScheduler1.Appointments.EndUpdate(); Does not refresh the Scheduler view element.
To reproduce: Me.RadScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Timeline Dim timelineView As SchedulerTimelineView = Me.RadScheduler1.GetTimelineView() Dim currentScaling As SchedulerTimescale = timelineView.GetScaling() currentScaling.DisplayedCellsCount = 100 Try to scroll horizontally. Then, change the currentScaling.DisplayedCellsCount property to 50 and try to scroll again. You will notice a considerable difference. Workaround: reduce the number of the displayed visual cell elements by the DisplayedCellsCount.
Steps to follow: 1. Select cells from 10:00pm (today) to 01:00am (next day). 2. Right click -> New Appointment 3. The Edit Appointment Dialog opens and the End Time is set to 23:59:59 instead of 01:00:00
To reproduce: 1.Change the first day of week to Monday: SchedulerMonthView view = new SchedulerMonthView(); CultureInfo ci = new CultureInfo("en-US"); ci.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Monday; view.CurrentCulture = ci; this.radScheduler1.ActiveView = view; 2. Create an appointment with a recurrence rule illustrated in the attached screenshot. Imagine that today is Wednesday and the recurrence rule starts on Monday from the same week. As a result, you will notice that the WeeklyRecurrenceRule.FirstDayOfWeek is not set and the appointment occurs on the wrong Sundays. Refer to the attached screenshot. Workaround: private void radScheduler1_AppointmentAdded(object sender, AppointmentAddedEventArgs e) { if (e.Appointment.RecurrenceRule != null) { WeeklyRecurrenceRule r = e.Appointment.RecurrenceRule as WeeklyRecurrenceRule; r.FirstDayOfWeek = DayOfWeek.Monday; } }
1. Create a new project with RadScheduler. 2. Handle the AppointmentFormatting event and change appointment border color. 3. Run the project and add an appointment.
When you subscribe to the AppointmentMoved or AppointmentDropped event of RadScheduler, the DataItem property of the appointment in the event args is always null.
To reproduce: public Form1() { InitializeComponent(); for (int i = 0; i < 7; i++) { this.radScheduler1.Appointments.Add(new Appointment(DateTime.Now.AddHours(i),TimeSpan.FromHours(3),"App" + i)); } this.radScheduler1.AutoSizeAppointments = true; this.radScheduler1.ActiveViewType = SchedulerViewType.Month; SchedulerMonthView monthView = this.radScheduler1.GetMonthView(); monthView.EnableAppointmentsScrolling = true; } Workaround: set the AutoSizeAppointments property to false.
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;
The occurrences and the navigation arrows are not displayed correctly when using YearlyRecurrence with the "First Monday of January" rule. The issue also appears with similar rule types.
To reproduce: Color[] colors = new Color[] { Color.LightBlue, Color.LightGreen, Color.LightYellow, Color.Red, Color.Orange, Color.Pink, Color.Purple, Color.Peru, Color.PowderBlue }; Random rand = new Random(); for (int i = 0; i < 25; i++) { Resource resource = new Resource(); resource.Id = new EventId(i); resource.Name = i + ".Resource"; resource.Color = colors[rand.Next(0, colors.Length)]; this.radScheduler1.Resources.Add(resource); } this.radScheduler1.GroupType = GroupType.Resource; this.radScheduler1.ActiveView.ResourcesPerView = this.radScheduler1.Resources.Count; for (int i = 0; i < 3; i++) { Appointment a = new Appointment(DateTime.Now.AddHours(i), TimeSpan.FromMinutes(30), "A" + i); a.ResourceId = this.radScheduler1.Resources.Last().Id; this.radScheduler1.Appointments.Add(a); } NOTE: it is also valid for the horizontal scrollbar in Timeline view. Workaround: use the SetResourceSize to increase the last resource's width a little bit: http://docs.telerik.com/devtools/winforms/scheduler/views/grouping-by-resources
To reproduce: RadSchedulerLocalizationProvider.CurrentProvider = new CustomSchedulerLocalizationProvider(); radScheduler1.Appointments.Add(new Appointment(DateTime.Now.AddDays(-5), DateTime.Now.AddDays(-4))); radScheduler1.Appointments.Add(new Appointment(DateTime.Now.AddDays(5), DateTime.Now.AddDays(4))); Workaround: radScheduler1.SchedulerElement.Refresh();
FIX. RadScheduler - AppointmentDeleted is fired even though the user cancelled the deletion (pressed Cancel on the dialog)
Steps to reproduce: radScheduler.ActiveViewType = SchedulerViewType.Timeline; radScheduler.GetTimelineView().ShowTimescale(Timescales.Hours); radScheduler.GetTimelineView().GetTimescale(Timescales.Hours).DisplayedCellsCount = 10;//set 8 for workarround. radScheduler.ActiveView.StartDate = DateTime.Today; radScheduler.GetTimelineView().RangeStartDate = DateTime.Today.AddHours(7); radScheduler.GetTimelineView().RangeEndDate = DateTime.Today.AddDays(1); radScheduler.GetTimelineView().ResourcesPerView = 5; radScheduler.GroupType = GroupType.Resource; radScheduler.SchedulerElement.SetResourceHeaderAngleTransform(SchedulerViewType.Timeline, 0);
When you select multiple cells in MultiDayView and right-click somewhere to open the context menu, some of the cells will be deselected.