Jump to content
Software FX Community

Exception after clicking custom sub menu item


User (Legacy)

Recommended Posts

Hello,

I am getting "System.NullReferenceException: Object reference not set to an

instance of an object" when I click submenu Item of a custom menu item.

I am adding custom commands and sub commands in context menu of a web based

chart. (Please see attached file) Clicking "Command 1" does not give an

error. But clicking "Command 6" and "Command 7" gives following error.

Also my command handler is never being called as there is no event to bind

my event handler to.

Thanks.

Farhan

------------Error Message---------------

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.NullReferenceException: Object reference not set to an instance of an

object.

at SoftwareFX.ChartFX.Internet.CommandBar.J(Object 6G, Int32 6H, ICommand

6I, Int32& 6J)

at SoftwareFX.ChartFX.Internet.CommandBar.I(Object 6C, Int32 6D, ICommand

6E, Int32& 6F)

at SoftwareFX.ChartFX.Internet.Client.00.OnClick(EventArgs e)

at System.Windows.Forms.MenuItemData.Execute()

at System.Windows.Forms.Command.Invoke()

at System.Windows.Forms.Control.WmCommand(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)

Link to comment
Share on other sites

To further elaborate the situation, the event UserCommand only exists for 

SoftwareFX.ChartFX.Chart (WinForms control) and not in

SoftwareFX.ChartFX.Internet.Server.Chart (WebForms control). But you can

add/update/delete commands just like you can for WinForms controls, only

there is no even to bind to. Any suggestions?

Farhan

"Farhan Noor Qureshi" <fqureshi--NO--SPAM--@teknotelecom.com> wrote in

message news:48t3LzbfFHA.2524@webserver3.softwarefx.com...

> Hello,

>

> I am getting "System.NullReferenceException: Object reference not set to

> an instance of an object" when I click submenu Item of a custom menu item.

>

> I am adding custom commands and sub commands in context menu of a web

> based chart. (Please see attached file) Clicking "Command 1" does not give

> an error. But clicking "Command 6" and "Command 7" gives following error.

>

> Also my command handler is never being called as there is no event to bind

> my event handler to.

>

> Thanks.

>

> Farhan

>

> ------------Error Message---------------

> See the end of this message for details on invoking

> just-in-time (JIT) debugging instead of this dialog box.

>

> ************** Exception Text **************

> System.NullReferenceException: Object reference not set to an instance of

> an object.

> at SoftwareFX.ChartFX.Internet.CommandBar.J(Object 6G, Int32 6H,

> ICommand 6I, Int32& 6J)

> at SoftwareFX.ChartFX.Internet.CommandBar.I(Object 6C, Int32 6D,

> ICommand 6E, Int32& 6F)

> at SoftwareFX.ChartFX.Internet.Client.00.OnClick(EventArgs e)

> at System.Windows.Forms.MenuItemData.Execute()

> at System.Windows.Forms.Command.Invoke()

> at System.Windows.Forms.Control.WmCommand(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)

>

>

>

>

>

Link to comment
Share on other sites

Commands are only executed client side (no postback), that's why you don't 

see a UserCommand event in the server component.

For information on trapping Client-Side events (.NET client only) please

refer to the following KB article:

Q7121019. Accessing Chart Events from the Client-Side when generating .NET

Client Controls

You need full trust (unmanaged code execution permission) in order to trap

.NET events in JavaScript.

--

Francisco Padron

www.chartfx.com

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...