I am currently having some troubles and some mixed results on calendar controls. Currently I have a calendarInfo control bound to a bindingsource which is a custom object that has some of the appointed bound properties but not all. I have an ultraDayView control with the datasource set to the calendarInfo control. When I try to move the appointment more than a 15 minute increment it throws an Index was outside the bounds of the array error.
I think it may have something to do with the say I have mapped my object to the calendarInfo so I am attacking that piece of code.
Mapping Code:
Private Sub SetCalAppointmentBindings()
calInfo.DataBindingsForAppointments.DataSource =
NothingcalInfo.DataBindingsForAppointments.DataSource = bsTaskcalInfo.DataBindingsForAppointments.BindingContextControl = Me
calInfo.DataBindingsForAppointments.SubjectMember =
"TaskName"calInfo.DataBindingsForAppointments.DescriptionMember = "TaskDescription"calInfo.DataBindingsForAppointments.StartDateTimeMember = "DueDate"calInfo.DataBindingsForAppointments.EndDateTimeMember = "EndDate"calInfo.DataBindingsForAppointments.OwnerKeyMember = "SalesRepID"calInfo.DataBindingsForAppointments.DataKeyMember = "DataKeyMember"
End Sub
Here is the error and stack trace:
--------------------------------------------------
Index was outside the bounds of the array.
Error type: System.IndexOutOfRangeException
Source of error (stack trace):
Infragistics.Win.UltraWinSchedule.UltraDayView.EnsurePrimaryAppointmentIsFirst(Object[]& selectedAppts, Appointment primaryAppointment)
Infragistics.Win.UltraWinSchedule.UltraDayView.DragAppointmentsToTimeSlot(MouseMessageInfo msginfo)
Infragistics.Win.UltraWinSchedule.UltraDayView.DragAppointments(MouseMessageInfo msginfo)
Infragistics.Win.UltraWinSchedule.UltraDayView.Infragistics.Win.ISelectionManager.OnDragMove(MouseMessageInfo& msginfo)
Infragistics.Win.SelectionStrategyBase.DragMove(MouseMessageInfo msgInfo)
Infragistics.Win.SelectionStrategyExtended.OnMouseMove(ISelectableItem item, MouseMessageInfo& msginfo)
Infragistics.Win.SelectionStrategyExtended.OnMouseMessage(ISelectableItem item, MouseMessageInfo& msginfo)
Infragistics.Win.ControlUIElementBase.ProcessMouseMoveHelper(Object sender, MouseEventArgs e)
Infragistics.Win.ControlUIElementBase.ProcessMouseMove(Object sender, MouseEventArgs e)
Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e)
Infragistics.Win.UltraControlBase.OnMouseMove(MouseEventArgs e)
System.Windows.Forms.Control.WmMouseMove(Message& m)
System.Windows.Forms.Control.WndProc(Message& m)
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
System.Windows.Forms.Application.RunDialog(Form form)
System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
System.Windows.Forms.Form.ShowDialog()
CxUi5.fMain.OpenDialog(Type FormType, fBase Opener, Object[] Args) in D:\Development\CxUi5\CxUi5\Base Forms\fMain.vb:line 39
Any help would be great and I am sure additional info is needed.
Historically I have found that trying to anyalyze something like this without a sample that demonstrates the problem is impossible. If you can post something here we can take a look, otherwise report it as a bug and attach the project there.
We are having the same kind of errors when we try to update the datasource. At this point we also have concluded the schedule control is very buggy (we upgraded to version 8079). Can someone explain how to do the SuspendBinding operation? We are out of solutions right now.
Hi,
The thread and described issue is since 2011, so it means that there is discussed controls with version 11.1 or older. Could you please tell me what is your current version (please provide the whole build number. for example: 13.2.20132.2010 ) Are you able to reproduce the issue with our supported versions 13.1 / 13.2. If so, please upload small sample and I`ll be glad to research it for you.
Let me know if you have any questions.
Regards
We are using version 13.1.20131.2079 and as is often the case we are unable to reproduce consistently the bugs. It happens when the schedule control receive mouse move and mouse up events. It's also on a big b2b application and given the complexity of it's business rules and Infragisitcs bindings we are not able to extract a small sample of this dataset in a reasonable time (have to ship). Is there any chance you could inquire about a way to suspend/resume bindings to the schedule? The bug happens when we refresh the binding, it seems like the control is accessing the collection (on response to Windows events) while it's in an invalid state.
Thanks for the details. Looking at the provided information and more concrete "as is often the case we are unable to reproduce consistently the bugs", I suppose that maybe you are using multiple threads and/or CreationFilter/DrawFilter. If so, maybe something in that part of your code, cause this issue, but without to see your code, will be very difficult for me to give you a solution.
Please try to comment the code related with Creation/Draw Filters and try to reproduce the issue. I suppose that without Creation/Draw Filters, your application will works properly. If so, please check again your code related with Creation/Draw Filters and include IF conditions to skip Null obejects.
Thank you for the reply, we are indeed using a CreationFilter/DrawFilter based on your samples to display custom icons in the appointments. We have shuffled arround the binding methods until the bug is hard to trigger. It happens when the user click and move the mouse fast, since we get unhandled exceptions thrown from the control internal functions we can't catch them. The exceptions are the type expected with poor error handling, Null object reference and Index out of bounds.