Hello,
Our product uses the UltraWinSchedule control. When a user is using the UltraDayView mode and they right clicks the user will sometimes get a .NET error. It's erratic and we are unable to recreate the issue on our end. Have you guys heard of this issue or do you know what's causing it? The following is the exception text from the .NET error:
System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Win.UltraWinSchedule.UltraDayView.RestoreAppointmentsToPreDragPositions() at Infragistics.Win.UltraWinSchedule.UltraDayView.OnDragOperationEnded(Boolean hadStarted, Boolean canceled) at Infragistics.Win.UltraWinSchedule.UltraDayView.Infragistics.Win.ISelectionManager.OnDragEnd(Boolean cancelled) at Infragistics.Win.UltraWinSchedule.UltraDayView.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.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Thanks,
Bob
Hi Brian,
I have logged a support request;
One thing I noted in the request was the following -
The "Right Mouse Click" could be a red herring. The users would be doing a LEFT mouse click to select an appointment or timeslot and then they would be quickly following that with a RIGHT mouse click. The exception may appear to be raised from the RIGHT mouse click, but it takes a few milliseconds for the exception to surface to the user and they percieve it as having occurred on the RIGHT mouse click whereas the offending code may lie with the LEFT click.
It seems impossible to raise the "Drag Events" with the RIGHT mouse click, so I the problem lay with the Left Click Select code and perhaps the user is Moving the appointment a small distance which is triggering the "Drag Events"
Kind Regards
Aaron
Hi Brian.
I can't reproduce it - it happens randomly. The user right mouse clicks the appointment and it happens and before the custom context menu even appears it throws the exception.
Is it even possible for any of the drag/appointment moved before and after events fire when user is RIGHT MOUSE clicking??? I don't think it is.
I can't be 100% that this is the case all the time but I suspect the user is unknowingly dragging the appointment a small distance (or doing something to trigger the drag events) when they LEFT clicking to select an appointment object, before they proceed to then Right Mouse Click it. The time between left clicking and right clicking the appointment is probably very quick.
Can you please provide a hotfix which captures the possible null reference exceptions and I will test immediately and promptly provide you feedback.
Thanks in Advance!
This certainly looks like a bug in the control, so I'm not sure you'll be able to easily work around it. Ideally you should send us a sample that reproduces the issue so we can say conclusively what causes it (and then fix it). If that isn't possible, we can try to address the null ref exception and then you'll have to let us know if it solves the problem for you.
My Users are also sporadically receiving this error on RIGHT MOUSE CLICK.
ERROR - UNHANDLED EXCEPTION.
Message: Object reference not set to an instance of an object.TargetSite: Void RestoreAppointmentsToPreDragPositions()StackTrace: at Infragistics.Win.UltraWinSchedule.UltraDayView.RestoreAppointmentsToPreDragPositions() at Infragistics.Win.UltraWinSchedule.UltraDayView.OnDragOperationEnded(Boolean hadStarted, Boolean canceled) at Infragistics.Win.UltraWinSchedule.UltraDayView.Infragistics.Win.ISelectionManager.OnDragEnd(Boolean cancelled) at Infragistics.Win.UltraWinSchedule.UltraDayView.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.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I am guessing here but let me know if this could be the cause;
Perhaps the "APPOINTMENT" object IS going out of memory. In some circumstances, shortly after Right mouse clicking, the appointment data source is refreshed from the server. Essentially clearing the appointment object from memory and reloading in appointments again.
Is there anyway to flush ALL events from the UltraDayView before I refresh the CalendarInfo data source? Do I simply call "Application.DoEvents" before I refresh the data source?
Or will calling;
Me.UltraDayViewAppointments.EventManager.AllEventsEnabled = False On the UltraDayView item disable or flush this event from firing and then after the appointment is refreshed then re-enable the events?
Me.CalendarInfo.EventManager.AllEventsEnabled = False On the calendarinfo disable this event from firing in the dayview object?
Hello Joe,
I am not experiencing any difficultly with the default settings of the DayView control. I attached a sample, see below. I would like for you to please modify it so that it reproduces the behavior. Let me know if you have any questions regarding this matter.