ViewXY null reference exception when setting axis.visible

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

ViewXY null reference exception when setting axis.visible

Post by greggorob64 » Tue Jun 10, 2014 3:18 pm

I'm trying to set up my graphing controls hide many features when minimized and show them when maximized. For some reason; i'm getting an exception when I attempt to hide the Y-Axis in my 2-d recording. Any ideas what I can do about this?

Image

System.ArgumentOutOfRangeException occurred
HResult=-2146233086
Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source=mscorlib
ParamName=index
StackTrace:
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
InnerException:


Image

Thanks!

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: ViewXY null reference exception when setting axis.visibl

Post by ArctionPasi » Tue Jun 10, 2014 4:21 pm

Please update to 6.0.5 and let me know if the problem persists.
LightningChart Support Team, PT

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

Re: ViewXY null reference exception when setting axis.visibl

Post by greggorob64 » Tue Jun 10, 2014 5:38 pm

That worked, thanks! I also had to make a small change, since the 'ownerview' got moved to read-only

Image

Was I using it incorrectly there originally?

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: ViewXY null reference exception when setting axis.visibl

Post by ArctionPasi » Tue Jun 10, 2014 5:53 pm

The view object is intended to be given as constructor parameter. To prevent misunderstandings OwnerView was made read-only.
LightningChart Support Team, PT

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

Re: ViewXY null reference exception when setting axis.visibl

Post by greggorob64 » Thu Jun 12, 2014 2:08 pm

Going back to this; I'm thinking the root cause was me accidentally using Suspend/Resume Layout instead of Begin/End Update.