To reproduce: - Use the search in the scheduler navigator. - Sort the grid by start/end date. - The values are sorted as strings. Workraround: - Use custom sorting.
It is possible to schedule multiple appointments in the same time period. In some scenario's this should be avoided. When the agenda can change from outside the scheduler, sometimes conflics will apear when the resource is not visible on the scheduler. It would be nice to have a list of all the conflicted appointments
Use attached to reproduce. Workaround: protected override void OnShown(EventArgs e) { base.OnShown(e); radScheduler1.SchedulerElement.ViewElement.UpdateCells(); }
How to rerproduce: this.radScheduler1.AccessibleInterval.Start = new DateTime(2018, 7, 18, 00, 00, 00).AddMonths(-2); this.radScheduler1.AccessibleInterval.End = new DateTime(2018, 7, 18, 00, 00, 00).AddMonths(2); this.radScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Month; Workaround: public class CustomRadScheduler : RadScheduler { private FieldInfo schedulerFi; private FieldInfo activeViewsFi; private MethodInfo onPropertyChangedMi; private MethodInfo setActiveViewMi; protected override void CreateChildItems(RadElement parent) { base.CreateChildItems(parent); this.activeViewsFi = typeof(RadScheduler).GetField("activeViews", BindingFlags.Instance | BindingFlags.NonPublic); this.schedulerFi = typeof(SchedulerView).GetField("scheduler", BindingFlags.Instance | BindingFlags.NonPublic); this.onPropertyChangedMi = typeof(SchedulerView).GetMethod("OnPropertyChanged", BindingFlags.Instance | BindingFlags.NonPublic); this.setActiveViewMi = typeof(RadScheduler).GetMethod("SetActiveView", BindingFlags.Instance | BindingFlags.NonPublic); } public override string ThemeClassName { get { return typeof(RadScheduler).FullName; } } /// <summary> /// Gets or sets the type of the active view. /// </summary> /// <value>The type of the active view.</value> [DefaultValue(SchedulerViewType.Day)] [NotifyParentProperty(true)] public override SchedulerViewType ActiveViewType { get { return base.ActiveViewType; } set { if (this.ActiveViewType != value && value == SchedulerViewType.Month) { SchedulerView newView; Dictionary<SchedulerViewType, SchedulerView> activeViews = this.activeViewsFi.GetValue(this) as Dictionary<SchedulerViewType, SchedulerView>; if (activeViews.ContainsKey(value)) { newView = activeViews[value]; } else { SchedulerView view = new CustomSchedulerMonthView(); this.schedulerFi.SetValue(view, this); this.onPropertyChangedMi.Invoke(view, new object[] { new string[] { "Scheduler" } }); newView = view; } if (this.ActiveView != newView && newView != null) { this.setActiveViewMi.Invoke(this, new object[] { newView, true }); } } else { base.ActiveViewType = value; } } } } public class CustomSchedulerMonthView : SchedulerMonthView { public override SchedulerView OffsetView(int offset) { if (this.ShowFullMonth) { DateTime dtStart = DateHelper.GetStartOfMonth(this.StartDate); if (this.StartDate.Day > 1) { dtStart = dtStart.AddMonths(1); } dtStart = dtStart.AddMonths(offset); return this.CreateViewWithStartDate(dtStart); } else { DateTime startDate = this.StartDate.Add(new TimeSpan(offset * this.OffsetTimeSpan.Ticks)); DateTimeInterval interval = new DateTimeInterval(startDate, this.GetEndDate(startDate)); if (this.Scheduler.AccessibleInterval.Contains(interval)) { return this.CreateViewWithStartDate(startDate); } if (true) { } return this.CreateViewWithStartDate(startDate); } } protected override SchedulerView CreateViewWithStartDate(DateTime startDate) { SchedulerMonthView monthView = new SchedulerMonthView(); this.CopyPropertiesToView(monthView); DateTimeInterval interval = new DateTimeInterval(startDate, this.GetEndDate(startDate)); if (interval.End > this.Scheduler.AccessibleInterval.End) { startDate = startDate.Add(new TimeSpan(-1 * this.OffsetTimeSpan.Ticks)); } if (interval.Start < this.Scheduler.AccessibleInterval.Start) { startDate = startDate.Add(new TimeSpan(1 * this.OffsetTimeSpan.Ticks)); } monthView.StartDate = startDate; if (this.ShowFullMonth) { monthView.WeekCount = DateHelper.GetMonthDisplayWeeks(startDate, this.CurrentCulture.DateTimeFormat); } return monthView; } }
How to reproduce: public partial class RadForm1 : Telerik.WinControls.UI.RadForm { public RadForm1() { InitializeComponent(); this.radScheduler1.MouseMove += RadScheduler1_MouseMove; this.radScheduler1.GroupType = GroupType.Resource; Appointment appointment = new Appointment(DateTime.Today.AddHours(13), TimeSpan.FromHours(1), "Test Appointment"); this.radScheduler1.Appointments.Add(appointment); } private void RadScheduler1_MouseMove(object sender, MouseEventArgs e) { Point pt = this.radScheduler1.PointToClient(Cursor.Position); SchedulerCellElement cell = this.radScheduler1.SchedulerElement.ElementTree.GetElementAtPoint(pt) as SchedulerCellElement; if (cell != null) { if (cell.Date != null) { Console.WriteLine(cell.Date.ToShortTimeString()); } } } private void button1_Click(object sender, EventArgs e) { switch (this.radScheduler1.ActiveViewType) { // showing the Day View case SchedulerViewType.Day: var theDayView = this.radScheduler1.GetDayView(); if (theDayView != null) { RulerPrimitive ruler = (this.radScheduler1.SchedulerElement.ViewElement as SchedulerDayViewElement).DataAreaElement.Ruler; ruler.RangeFactor = ScaleRange.QuarterHour; ruler.StartScale = 8; ruler.EndScale = 18; } break; } } } Workaround: instead of accessing directly the ruler, apply the scaling on the view element private void button2_Click(object sender, EventArgs e) { switch (this.radScheduler1.ActiveViewType) { // showing the Day View case SchedulerViewType.Day: var theDayView = this.radScheduler1.GetDayView(); if (theDayView != null) { theDayView.RangeFactor = ScaleRange.QuarterHour; theDayView.RulerStartScale = 8; theDayView.RulerEndScale = 18; } break; } }
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
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.
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);
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.
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
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.
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.
Steps that lead to the undesired behavior:
1. Create a VB project with one of the templates:
2. Initially, there is no subscription to the CalendarUserControl.Load event:
3. After opening the designer, you are subscribing to the Load event by double-clicking the Load event in the Properties section:
Then, the generated event handler is underlined as in the above screenshot.
I have tested in brand new projects (.NET 6 and .NET Framework) and the default functionality of the drag drop services in RadScheduler and RadGridView. Indeed, the cursor is missing in .NET 6. The following screenshots illustrate the difference.
.NET 6: