Page 1 of 1

Nullreference exception when accessing control

Posted: Wed Jun 11, 2014 7:55 pm
by greggorob64
This issue is similar to my last one (index out-of-range exception) Forgive the humongous pic, i dont know of a better way to display the info. Im using Devexpress to display my lightning charts in a tile fashion. While maximizing and minimizing the chart a few times (makes the chart look like a thumbnail). I reliably get a null reference exception. Shown below is the info:

It's worth noting that no other threads are trying to modify the graph at this point.

Edit: it seems like putting the margin's settings after the endupdate seems to make the issue not show up.

Image

Re: Nullreference exception when accessing control

Posted: Thu Jun 12, 2014 7:59 am
by ArctionTero
Looks like chart is trying to draw itself at that point, which should not be possible if BeginUpdate() is called at your derived class SuspendLayout() method.

Are you sure that there is no EndUpdate() call at some point after (or at) the SuspendLayout() and before Margins setter?

Sample application with source would help us to resolve this (would be nice if you could provide us with one), or are you satisfied with your current solution?

Re: Nullreference exception when accessing control

Posted: Thu Jun 12, 2014 1:08 pm
by greggorob64
Ha, so i just noticed i was using begin\end update in some places, and suspend\resume layout in others.

Im mixing up my terminology. I'll try to make them all begin\end update and see if that helps

Re: Nullreference exception when accessing control

Posted: Thu Jun 12, 2014 2:33 pm
by greggorob64
I switching everything to use beginning/end callback, but im still having issues:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at A.OH.SH(List`1 A, Single B)
at Arction.LightningChartUltimate.LightningChartUltimate.AQC(PointLineSeriesBase A, Int32 B, Double C, Double F, Double G, GraphSegmentInfo H, Int32 I)
at Arction.LightningChartUltimate.LightningChartUltimate.ZPC(Object A)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()