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 FunctionActual: 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
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
Additional borders appear in AgendaView when the Date column is sorted. This behavior is observed in the following themes:
Hi Guys,
the colour scheme on your SchedulerBinderDataSource Appointment Mapping form is barely visible
Could you please darken the text so I can map things without squinting.
Thanks.
1) create new project with a radScheduler
2) add a new appointment with a subject of: <>
3) program will crash with System.InvalidOperationException: 'Collection was modified after the enumerator was instantiated.'
The program will crash even if you have additional text before the "<>" but having text after it will allow the program to continue running however, none of the text after the "<>" will display.
Hello,
I found an issue when retrieving appointments using MultiDayView.GetAppointmentsInInterval
The issue occurs when creating a new appointment where AllDay is set to true
In the appointment, the Start and End date is automatically both set to the same value
When adding the appointment to the MultidayView and retrieving the appointments in interval (interval is set to 1 minute) the Appointment is not returned.
I guess the call only uses the Start and End date and not using the AllDay value
Grtz Patrick
Here is the code snippet:
Sub New()
InitializeComponent()
Dim culture As CultureInfo = New CultureInfo("en-US")
culture.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Monday
culture.DateTimeFormat.CalendarWeekRule = CalendarWeekRule.FirstFourDayWeek
Me.RadScheduler1.Culture = culture
Me.RadScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Timeline
Dim timelineView As SchedulerTimelineView = Me.RadScheduler1.GetTimelineView()
Dim scale As Timescales = Timescales.Weeks
timelineView.ShowTimescale(scale)
End Sub
Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim baseDate As DateTime = DateTime.Today
Dim start As DateTime() = New DateTime() {baseDate.AddHours(14.0), baseDate.AddDays(1.0).AddHours(9.0), baseDate.AddDays(2.0).AddHours(13.0)}
Dim [end] As DateTime() = New DateTime() {baseDate.AddHours(16.0), baseDate.AddDays(1.0).AddHours(15.0), baseDate.AddDays(2.0).AddHours(17.0)}
Dim appointment As Appointment = Nothing
For i As Integer = 0 To 2
appointment = New Appointment(start(i), [end](i), "A" & i, "D" & i, "L" & i)
Me.RadScheduler1.Appointments.Add(appointment)
Next
Me.RadScheduler1.ActiveView.StartDate = New DateTime(2020, 10, 11)
End SubYou will notice that if the StartDate is changed the appointments occupy the wrong cells until you scroll horizontally and the view is updated.

Hi,
I am using the CalHelper (as suggested by this) in order to convert RecurrenceRule back and forth to string in order to persist on the database.
With the minutely recurrence rule, it seems like the conversion is not done correctly.
Please check the below code:
var recurrenceRule = new MinutelyRecurrenceRule();
recurrenceRule.Start = new DateTime(2020, 4, 1);
recurrenceRule.Interval = 30;
recurrenceRule.End = new DateTime(2020, 4, 1, 2, 0, 0);
var qString = CalHelper.RecurrenceRuleToString(recurrenceRule);
RecurrenceRule recurrenceRule1;
CalHelper.TryParseRecurrenceRule(qString, out recurrenceRule1);// recurrenceRule1 will be null
Is there a way to fix this issue?
Thanks,
Please run the attached sample project and follow the steps illustrated in the gif file. Not always the selected appointment is dragged.
Workaround:
public class CustomSchedulerInputBheavior : SchedulerInputBehavior
{
public CustomSchedulerInputBheavior(RadScheduler scheduler) : base(scheduler)
{
}
Point mouseDownPosition = Point.Empty;
public override bool HandleMouseDown(MouseEventArgs args)
{
mouseDownPosition = args.Location;
return base.HandleMouseDown(args);
}
public override bool HandleMouseMove(MouseEventArgs args)
{
SchedulerCellElement cell = this.Scheduler.ElementTree.GetElementAtPoint(args.Location) as SchedulerCellElement;
AppointmentElement appointment = this.Scheduler.ElementTree.GetElementAtPoint(args.Location) as AppointmentElement;
if (appointment == null)
{
appointment = this.Scheduler.ElementTree.GetElementAtPoint(this.mouseDownPosition) as AppointmentElement;
}
if (this.Scheduler.Behavior.ItemCapture != null && (this.Scheduler.Behavior.ItemCapture.Parent is RadScrollBarElement ||
this.Scheduler.Behavior.ItemCapture is RadScrollBarElement))
{
return false;
}
if (this.Scheduler.Capture && args.Button == MouseButtons.Left)
{
appointment = this.Scheduler.ElementTree.GetElementAtPoint(this.mouseDownPosition) as AppointmentElement;
FieldInfo fi = typeof(SchedulerInputBehavior).GetField("selecting", BindingFlags.Instance| BindingFlags.NonPublic);
bool selecting = (bool)fi.GetValue(this);
if (selecting)
{
if (cell != null && cell.AllowSelection && args.Button == MouseButtons.Left)
{
this.SelectCell(cell, true);
}
}
else if (this.Scheduler.SchedulerElement.ResizeBehavior.IsResizing)
{
this.Scheduler.SchedulerElement.ResizeBehavior.Resize(args.Location);
}
else if (appointment != null && IsRealDrag(args.Location))
{
this.Scheduler.Capture = false;
this.Scheduler.DragDropBehavior.BeginDrag((SchedulerVisualElement)appointment.Parent, appointment);
return true;
}
}
else
{
if (appointment != null)
{
this.Scheduler.SchedulerElement.ResizeBehavior.RequestResize(appointment, (SchedulerVisualElement)appointment.Parent, false);
}
else
{
this.Scheduler.Cursor = Cursors.Default;
}
}
return false;
}
private void SelectCell(SchedulerCellElement cell, bool extend)
{
this.Scheduler.SelectionBehavior.SelectCell(cell, extend);
}
}this.radScheduler1.SchedulerInputBehavior = new CustomSchedulerInputBheavior(this.radScheduler1);
Currently,
I’m using the Radscheduler MultiDayView to create a “two week” view in which
the end user has the possibility to choose if he wants to see weekend days or
not.
When this
view is used in combination with appointments spanning multiple days and the display
of the weekend days, every thing works fine (with_weekend.png). The appointment
starts at 06/21/19 05:00 and ends 06/24/19 21:05.
However, if
weekend days are not shown in this view (without_weekend.png), part of the same
appointment is shown on 06/25/19 and the end time on 06/24/19 is also incorrect.
How can I solve this? It is not an option to show it as an “All day appointment” since the customer wants to know the exact start and end time.
Hi,
using a RadScheduler into a desktop application. It seems like, on mouse-down event happening into a cell of the first row, the grid of the scheduler is shifting down of a row, resulting in the mouse handle being on the previous row's cell. No mouse wheel scrolled, no other mouse movement. Just one left-click. The result is that on mouse-up we are in a different cell and our event-handler is getting confused.
Sorry for not having any code snippet, I just attach a video of what's happening. Consider that I have only positioned the mouse on the cell at 8am and left-clicked. Tested also with version 2019.2.508 (even though in our app we are still using 2016.2.608).
Thanks in advance and best regards,
Emanuele Nava
Apogeo srl
Italy
Hello,
We have developed an ASP.NET application and a WinForms application that both uses Telerik RadScheduler. The applications share the same data.
We have set EnableExactTimeRendering = true to prevent appointments to falsely be displayed as collisions.
Our problem is that appointments with short durations (0-4 minutes) are totally invisible in the WinForms Scheduler. In the ASP.NET scheduler all appointments are visible. An appointment with no duration (0 minutes) is shown as 30min appointment in ASP.NET while 1-minute appointments are shown as a thin line which is ok as we use tooltips for all appointments.
How can we make all appointments visible in WinForms and still use EnableExactTimeRendering? Of course, the rendering will not be exact for small durations but that is better than not showing the appointments at all. We would like to set a minimum size for appointments.
Best regards,
Daniel Gidlöf
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;
}
}
How to reproduce: check the attached (video radscheduler-selection-incorrect.gif)
public RadForm1()
{
InitializeComponent();
Appointment appointment = new Appointment(DateTime.Today.AddHours(13), TimeSpan.FromHours(1), "Test Appointment");
this.radScheduler1.Appointments.Add(appointment);
for (int i = 0; i < 25; i++)
{
appointment = new Appointment(DateTime.Today.AddHours(24), TimeSpan.FromHours(1), "AllDay: " + i);
appointment.AllDay = true;
this.radScheduler1.Appointments.Add(appointment);
}
this.radScheduler1.AllowAppointmentsMultiSelect = true;
}
Workaround: create a custom input behavior
this.radScheduler1.SchedulerInputBehavior = new CustomSchedulerInputBehavior(this.radScheduler1);
public class CustomSchedulerInputBehavior : SchedulerInputBehavior
{
public CustomSchedulerInputBehavior(RadScheduler scheduler)
: base(scheduler)
{
}
public override bool HandleMouseWheel(MouseEventArgs args)
{
if (!this.Scheduler.AllowMouseWheelSupport)
return false;
bool scrolled = false;
if (this.Scheduler.SelectionBehavior.IsAllDayAreaSelection || this.IsLastSelectedAppointmentAllDay(this.Scheduler.SelectionBehavior.SelectedAppointments))
{
if (this.Scheduler.GroupType == GroupType.Resource)
{
SchedulerDayViewGroupedByResourceElement grouped = this.Scheduler.ViewElement as SchedulerDayViewGroupedByResourceElement;
IList<SchedulerDayViewElement> childViews = grouped != null ? grouped.GetChildViewElements() : null;
if (childViews != null && childViews.Count > 0)
{
RadScrollBarElement scroll = childViews[childViews.Count - 1].AllDayHeaderElement.ScrollBar;
if (scroll.Visibility != ElementVisibility.Collapsed)
{
int newValue = scroll.Value - childViews[childViews.Count - 1].AllDayHeaderElement.HeaderHeight * Math.Sign(args.Delta);
newValue = Math.Max(Math.Min(newValue, scroll.Maximum - scroll.LargeChange + 1), scroll.Minimum);
scroll.Value = newValue;
scrolled = true;
}
}
}
else
{
SchedulerDayViewElement dayView = this.Scheduler.ViewElement as SchedulerDayViewElement;
RadScrollBarElement scroll = dayView != null ? dayView.AllDayHeaderElement.ScrollBar : null;
if (scroll != null && scroll.Visibility != ElementVisibility.Collapsed)
{
int newValue = scroll.Value - dayView.AllDayHeaderElement.HeaderHeight * Math.Sign(args.Delta);
newValue = Math.Max(Math.Min(newValue, scroll.Maximum - scroll.LargeChange + 1), scroll.Minimum);
scroll.Value = newValue;
scrolled = true;
}
}
}
if (scrolled)
{
return false;
}
if (args.Delta > 0)
{
this.Scheduler.ViewElement.Scroll(true);
}
else
{
this.Scheduler.ViewElement.Scroll(false);
}
return false;
}
private bool IsLastSelectedAppointmentAllDay(ReadOnlyCollection<IEvent> selectedAppointments)
{
if (selectedAppointments.Count > 0)
{
return selectedAppointments[selectedAppointments.Count - 1].AllDay;
}
return false;
}
}
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.
Workaround: create a custom Appointment and override the PaintRecurrenceIcon method
Public Class MyAppointmentElement
Inherits AppointmentElement
Public Sub New(scheduler As RadScheduler, view As SchedulerView, appointment As IEvent)
MyBase.New(scheduler, view, appointment)
End Sub
Public Overrides Sub PaintRecurrenceIcon(graphics As IGraphics)
If Not Me.Recurring Then
Return
End If
Dim icon As Image = DirectCast(GetType(AppointmentElement).GetMethod("GetRecurrenceIcon", BindingFlags.Instance Or BindingFlags.NonPublic).Invoke(Me, Nothing), Image)
If icon Is Nothing Then
Return
End If
SyncLock icon
Dim clientRect As RectangleF = Me.GetClientRectangle(Me.Bounds.Size)
Dim x As Integer = CInt(clientRect.X) + CInt(clientRect.Width) - icon.Width
If Me.RightToLeft Then
x = CInt(clientRect.X)
End If
Dim imageRect As Rectangle = New Rectangle(x, CInt(clientRect.Y) + CInt(clientRect.Height) - icon.Height, icon.Width, icon.Height)
graphics.DrawImage(imageRect, icon, ContentAlignment.TopLeft, True)
End SyncLock
End Sub
End Class
Public Class MyElementProvider
Inherits SchedulerElementProvider
Public Sub New(scheduler As RadScheduler)
MyBase.New(scheduler)
End Sub
Protected Overrides Function CreateElement(Of T As SchedulerVisualElement)(view As SchedulerView, context As Object) As T
If GetType(T) = GetType(AppointmentElement) Then
Return TryCast(New MyAppointmentElement(Me.Scheduler, view, DirectCast(context, IEvent)), T)
End If
Return MyBase.CreateElement(Of T)(view, context)
End Function
End Class