Profile Picture

NullReferenceException While Intializing NExplorerBar

Posted By Eshar Gal 14 Years Ago
Author
Message
Eshar Gal
sad Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 5, Visits: 1
Maybe I'm just doing something wrong, I have no idea.

/////////////////////////////////////////////////////////////////////////////
var rates = from rate in MainForm.readData.Rates
orderby rate.ValidFrom descending
select rate;

int counter = 1;


foreach (CViwer.Rate row in rates)
{
NBand band ;

NExplorerBar explorerBar = new NExplorerBar();//NullReferenceException
Console.WriteLine(counter.ToString());
counter++;


bool yearExists = false;

foreach (Control c in panelBar.Controls)
{
NBand cBand = (NBand)c;
if (cBand.Caption == row.ValidFrom.Year.ToString())
{
band = cBand;
explorerBar = (NExplorerBar)band.Tag;
yearExists = true;

break;
}
}

if (!yearExists)
{

band = new NBand();
band.Caption = row.ValidFrom.Year.ToString();
band.TextAlign = HorizontalAlignment.Center;
panelBar.Controls.Add(band);

explorerBar = new NExplorerBar();
explorerBar.Dock = DockStyle.Fill;
band.Controls.Add(explorerBar);
band.Tag = explorerBar;
}

NExpander nexpender = new NExpander();
nexpender.Text = "Expander " + row.Id.ToString();

Rates ratesForm = new Rates();
nexpender.Height = ratesForm.Height + 35;

ratesForm.Location = new Point(0, 30);

nexpender.Controls.Add(ratesForm);
nexpender.State = ExpanderState.Collapsed;
explorerBar.Controls.Add(nexpender);

}

}

A first chance exception of type 'System.NullReferenceException' occurred in Nevron.Presentation.dll
System.Transactions Critical: 0 : http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/UnhandledUnhandled exceptionCViwer.vshost.exeSystem.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Object reference not set to an instance of an object. at Nevron.UI.WinForm.Controls.NSkinManager.lIIIll111()
at Nevron.UI.WinForm.Controls.NSkinManager.UnregisterSkinnableInstance(INSkinnableControl control)
at Nevron.UI.WinForm.Controls.NExplorerBar.PerformDispose(Boolean disposing)
at Nevron.UI.WinForm.NControl.Dispose(Boolean disposing)
at System.ComponentModel.Component.Finalize()
System.NullReferenceException: Object reference not set to an instance of an object.
at Nevron.UI.WinForm.Controls.NSkinManager.lIIIll111()
at Nevron.UI.WinForm.Controls.NSkinManager.UnregisterSkinnableInstance(INSkinnableControl control)
at Nevron.UI.WinForm.Controls.NExplorerBar.PerformDispose(Boolean disposing)
at Nevron.UI.WinForm.NControl.Dispose(Boolean disposing)
at System.ComponentModel.Component.Finalize()

/////////////////////////////////////////////////////////////////////////////


It will happen every time at a different spot anywhere after 200 as far as i can see.

Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hello Eshar,

Do you receive this error if there is no skin applied?



Best Regards,
Nevron Support Team



Eshar Gal
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 5, Visits: 1
Hi,

Not sure if i know how to do this, what i was doing is adding NSkinManager.Instance.Enabled = false; Something did changed, I'm getting some native code pointer exception now or it will just crush.

To be honest, I'm not sure if i really want to pull 500 controls on the form. It is just something I'm playing around with and was wondering maybe I was doing something wrong.

Thanks.



Similar Topics


Reading This Topic