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.
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.
I attached the Source Code to my project and ran it. From what I found was that inside the EnsurePrimaryAppointmentIsFirst function there wasn't any Selected Appointments but it was hard coded to look at Index 0.
I can't tell if it's the Binding Source that is causing the Selected Appointments list to clear or my Objects. Either way I found a work around by suspending the binding source before and then resuming binding after.
I am currently working on to many projects and strict deadlines to create a test app that demonstrates this problem but I wanted to atleast post a work around incase somebody else ran into this problem.
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.