I have a Vb.Net (build with Visual Studio 2003) Windows application using Infragistics UltraWinSchedule.v5.3.
It was working fine for years but recently my clients are reporting crashes with big red X displayed instead of the schedule.
It happens only when they install it on new computers. The schedule contains hundreds of appointments and it looks like the control is not able to draw the appointments seeing that fast as the application can load them, as when I put a millisecond of delay between each appointment add, it works fine most of the time.
I know this version of Infragistics is not supported any more but if I have to upgrade I will have to migrate to .Net 2 (at least) which is not that easy – it is a big one and it’s been working fine for the past couple of years – why should I upgrade?
Does anyone have any ideas?
A red "X" through our Windows Forms controls means that an exception occurred while the control was painting.
The best way for us to help further is if you can provide us with a stack trace of the exception that occurred.
Based on your description of the issue, my first suspicion is that you are adding data to your UltraCalendarInfo object (or to its data source) on a background thread. Remember that Windows Forms controls (including ours) are not thread-safe. If you encountered an exception related to threading in our controls, a red "X" is the most common symptom. Such exceptions are usually NullReferenceException, IndexOutOfRangeException, or a similar type of exception. All updates to the UI must be done on the UI thread.
If you're not using threading, then please provide us with a stack trace, so that we can get a better idea of what's happening.
HI, Vince
Thanks for your reply. You are right; the application is loading the appointments on a different thread. However it’s strange that is working fine on most machines and fails on others.
Well I will change the code and send a setup for testing (I was never able to reproduce it on my computer) and let you know for the results.
Here are the exception messages:
System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Win.UltraWinSchedule.AppointmentsCollection.GetStartIndexForDate(DateTime subsetStartDateTime) at Infragistics.Win.UltraWinSchedule.AppointmentsCollection.DoesDateRangeHaveActivity(DateTime startDateTime, DateTime endDateTime, Boolean includeHidden) at Infragistics.Win.UltraWinSchedule.UltraCalendarInfo.DoesDateRangeHaveActivityHelper(DateTime startDateTime, DateTime endDateTime, Boolean useTime, Boolean includeHidden) at Infragistics.Win.UltraWinSchedule.UltraCalendarInfo.DoesDateRangeHaveActivity(DateTime startDateTime, DateTime endDateTime, Boolean useTime) at Infragistics.Win.UltraWinSchedule.Month.GetDay(Int32 day, Boolean createIfNull) at Infragistics.Win.UltraWinSchedule.UltraCalendarInfo.GetDay(DateTime date, Boolean createIfNull) at Infragistics.Win.UltraWinSchedule.UltraCalendarInfo.IsDateEnabled(DateTime date) at Infragistics.Win.UltraWinSchedule.MonthViewMulti.DayUIElement.InitAppearance(AppearanceData& appearance, AppearancePropFlags& requestedProps) at Infragistics.Win.UIElement.InitializeDrawAppearance(AppearanceData& defaultAppearance, AppearanceData& appearance) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused) at Infragistics.Win.UIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode) at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe) at Infragistics.Win.UltraWinSchedule.UltraScheduleControlBase.OnPaint(PaintEventArgs pe) at Infragistics.Win.UltraWinSchedule.UltraMonthViewMulti.OnPaint(PaintEventArgs pe) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
avramova_valeria said:However it’s strange that is working fine on most machines and fails on others.
The stack trace is a typical one for a threading exception, by the way.
Thank you very much, this help me a lot! I used the System.Timers.Timer instead of the System.Windows.Forms.Timer to refresh the appointements on the scroll event and after changing to the last one, all works perfectly.