New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Specified argument was out of the range of valid values. Parameter name: value error in Scheduler Timeline view

PROBLEM

The following error is encountered when the RadScheduler1.TimelineView.NumberOfSlots property is set to a big number and the column width is set in pixels so that Horizontal scroll appears. The issue is reproduced by having an appointment staring in one of the last slots in the view.

Server Error in '/' Application.


Specified argument was out of the range of valid values.
Parameter name: value

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value]
   System.Web.UI.WebControls.Unit..ctor(Double value, UnitType type) +9821778
   Telerik.Web.UI.Scheduler.Views.Timeline.TimelineAppointmentControl.GetWidth() +348
   Telerik.Web.UI.AppointmentControl.CalculateSize() +38
   Telerik.Web.UI.Scheduler.Views.Timeline.TimelineAppointmentControl.CalculateSize() +33
   Telerik.Web.UI.Scheduler.Views.AllDayLayout.CreateAppointmentControls(IEnumerable`1 slots, Boolean registerAppointmentControls) +817
   Telerik.Web.UI.Scheduler.Views.AllDayLayout.get_AppointmentControls() +24
   Telerik.Web.UI.Scheduler.Views.Timeline.RendererBase.CreateInnerContentTable(Control container, IList`1 allTimeLineSlots) +253
   Telerik.Web.UI.Scheduler.Views.Timeline.RendererBase.CreateInnerContentTable(Control container, IList`1 intervalSlots, Int32 minimumRowCount) +49
   Telerik.Web.UI.Scheduler.Views.Timeline.Renderer.GetInnerContent() +511
   Telerik.Web.UI.Scheduler.Views.SchedulerRenderer.GetContent() +75
   Telerik.Web.UI.RadScheduler.CreateContent() +122
   Telerik.Web.UI.RadScheduler.CreateChildControls(Boolean bindFromDataSource) +100
   Telerik.Web.UI.RadScheduler.ClearChildControls() +65
   Telerik.Web.UI.RadScheduler.Rebind() +12
   Telerik.Web.UI.RadScheduler.ProcessPostBackCommand(SchedulerPostBackEvent postBack) +2104
   Telerik.Web.UI.RadScheduler.RaisePostBackEvent(String eventArgument) +62
   Telerik.Web.UI.RadScheduler.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9883930
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3163.0

DESCRIPTION

The position of an appointment is saved and uses Microsoft's Unit struct, which has a limited range - The Unit class can represent values only between -32768 and 32767.

SOLUTION

As this is a limitation of the .NET Framework's struct, the possible workarounds are:

  • Decreasing the number of slots per view;
  • Decreasing the width of the slots;
  • Removing the horizontal scrolling by setting the column width in percentages;
In this article