On the Context Menu Showing Event of radScheduler,
I clear the current context menu then add some other RadMenuItems depending on the scenario.
on the first right click, the context menu shows.
but after right clicking anywhere on the RadScheduler (in any ActiveViewType)
the program crashes.
I got this error.
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index)
at Telerik.WinControls.RadItemCollection.get_Item(Int32 index)
at Telerik.WinControls.UI.MonthViewAreaElement.Scheduler_MouseDown(Object sender, MouseEventArgs e)
at Telerik.WinControls.UI.MonthViewAreaElement.HandleSchedulerMouseDown(MouseEventArgs e)
at Telerik.WinControls.UI.RadSchedulerElement.scheduler_MouseDown(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseDown(MouseEventArgs e)
at Telerik.WinControls.RadControl.OnMouseDown(MouseEventArgs e)
at Telerik.WinControls.UI.RadScheduler.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ICAM.Global.Main() in D:\TFS 20131025\ICAM4\ICAM4_v2\ICAM\Global.cs:line 151
Global.cs:line 151 is Application.Run(Form mainForm)
succeeding details show that it is on the library.
I put a break point on the first line of ContextMenuShowing, but error occurs right before it reaches the breakpoint.
I am using Telerik Q1 2014 for WinForms.
Could you help me solve this? Or am I missing some restrictions on using context menu in RadScheduler?
Thanks!
I clear the current context menu then add some other RadMenuItems depending on the scenario.
on the first right click, the context menu shows.
but after right clicking anywhere on the RadScheduler (in any ActiveViewType)
the program crashes.
I got this error.
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index)
at Telerik.WinControls.RadItemCollection.get_Item(Int32 index)
at Telerik.WinControls.UI.MonthViewAreaElement.Scheduler_MouseDown(Object sender, MouseEventArgs e)
at Telerik.WinControls.UI.MonthViewAreaElement.HandleSchedulerMouseDown(MouseEventArgs e)
at Telerik.WinControls.UI.RadSchedulerElement.scheduler_MouseDown(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseDown(MouseEventArgs e)
at Telerik.WinControls.RadControl.OnMouseDown(MouseEventArgs e)
at Telerik.WinControls.UI.RadScheduler.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ICAM.Global.Main() in D:\TFS 20131025\ICAM4\ICAM4_v2\ICAM\Global.cs:line 151
Global.cs:line 151 is Application.Run(Form mainForm)
succeeding details show that it is on the library.
I put a break point on the first line of ContextMenuShowing, but error occurs right before it reaches the breakpoint.
I am using Telerik Q1 2014 for WinForms.
Could you help me solve this? Or am I missing some restrictions on using context menu in RadScheduler?
Thanks!