Use the following code:
Public Sub New()
InitializeComponent()
RadSchedulerReminder1.TimeInterval = 500
Dim appointment As New Appointment(DateTime.Now.AddDays(-1), TimeSpan.FromHours(1), "A")
appointment.Reminder = New TimeSpan(10000)
Me.RadScheduler1.Appointments.Add(appointment)
Dim appointment2 As New Appointment(DateTime.Now.AddHours(-2), TimeSpan.FromHours(1), "B")
appointment2.Reminder = New TimeSpan(10000)
Me.RadScheduler1.Appointments.Add(appointment2)
RadSchedulerReminder1.StartReminderInterval = Date.Now.AddDays(-1)
RadSchedulerReminder1.EndReminderInterval = Date.Now.AddDays(1)
End Sub
Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
RadSchedulerReminder1.StartReminder()
RadScheduler1.ActiveViewType = SchedulerViewType.Week
End Sub
Drag "A" on the same interval as "B". You will notice that the reminder dialog will continue to show only "B".
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:
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
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
By default, each Appointment has two properties: ResourceId and ResourceIds. Usually, the ResourceId is used when you have only a single resource for the appointment. In case you have multiple resources for an appointment the ResourceIds collection is used. However, the current implementation of the EditAppointmentDialog uses a RadDropDownList for the resource selection. Thus, the user is not allowed to create an appointment and assign two resources to it. It can be achieved only programmatically. This is a common scenario when creating a meeting and you have at least two participants. A possible solution would be to replace the resources RadDropDownList with a RadCheckedDropDownList. Thus, the user will be able to select multiple resources.
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
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 Sub
You will notice that if the StartDate is changed the appointments occupy the wrong cells until you scroll horizontally and the view is updated.
To reproduce: public Form1() { InitializeComponent(); this.radScheduler1.ActiveViewType = SchedulerViewType.Timeline; Timescales scale = Timescales.Hours; this.radScheduler1.GetTimelineView().ShowTimescale(scale); Appointment app1 = new Appointment(DateTime.Today.AddHours(6), TimeSpan.FromMinutes(25), "A1"); Appointment app2 = new Appointment(DateTime.Today.AddHours(6).AddMinutes(25), TimeSpan.FromMinutes(16), "A2"); Appointment app3 = new Appointment(DateTime.Today.AddHours(6).AddMinutes(41), TimeSpan.FromMinutes(12), "A3"); this.radScheduler1.Appointments.Add(app1); this.radScheduler1.Appointments.Add(app2); this.radScheduler1.Appointments.Add(app3); this.radScheduler1.EnableExactTimeRendering = true; } Workaround: 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(TimelineAppointmentsPresenter)) { return new CustomTimelineAppointmentsPresenter(this.Scheduler, view, (SchedulerTimelineViewElement)context)as T; } return base.CreateElement<T>(view, context); } } public class CustomTimelineAppointmentsPresenter: TimelineAppointmentsPresenter { public CustomTimelineAppointmentsPresenter(RadScheduler scheduler, SchedulerView view, SchedulerTimelineViewElement timelineViewElement) : base(scheduler, view, timelineViewElement) { } protected override void ResolveOverlappingAppointments(SizeF availableSize) { List<AppointmentElement> appointments = new List<AppointmentElement>(); foreach (AppointmentElement element in this.AppointmentElements) { if (element.Visibility != ElementVisibility.Collapsed) { appointments.Add(element); } } appointments.Sort(new DateTimeComparer(this.Scheduler)); List<AppointmentElement> arrangedAppointments = new List<AppointmentElement>(); foreach (AppointmentElement appointment in appointments) { for (int i = 0; i < arrangedAppointments.Count; i++) { AppointmentElement otherAppointment = arrangedAppointments[i]; if (otherAppointment == appointment) { continue; } RectangleF rect = appointment.DesiredBounds; rect.Inflate(new SizeF(-2,-2)); if (otherAppointment.DesiredBounds.IntersectsWith(rect)) { appointment.DesiredBounds.Y = otherAppointment.DesiredBounds.Bottom; i = -1; continue; } } arrangedAppointments.Add(appointment); } } }
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);
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
Add the possibility either for the end user or the developer to modify the width or height (whichever is relevant) of the resource areas in different views.
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.
To reproduce: public Form1() { InitializeComponent(); CultureInfo culture = new CultureInfo("en-US"); culture.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Monday; this.radScheduler1.Culture = culture; this.radScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Month; 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); } Please refer to the attached gif file.