We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MenuItemAdv command binding

Thread ID:





98230 Feb 15,2011 11:50 PM UTC Feb 23,2011 10:03 AM UTC Silverlight 4
Tags: Tools
Keith Reimer
Asked On February 15, 2011 11:50 PM UTC

Hi, I'm trying to use the HierarchicalDataTemplate with command binding and I can't figure out how to bind the command for the items created by the template.

I set the Command on the parent MenuItemAdv, but it only gets called when the parent gets clicked - not when any of its children gets click. That makes sense, but I don't see any other place to bind the command for the templated child items, though.

Where can I bind the command that the children in the hierarchical data call?


Keith Reimer
Replied On February 16, 2011 12:12 AM UTC

I tried it like this as well:

Which gave me the binding for the command, but then I get an unhandled exception on the click:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; FDM; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; MS-RTC LM 8; eMusic DLM/4; Zune 4.0)
Timestamp: Wed, 16 Feb 2011 00:11:14 UTC

Message: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Windows.Shared.MenuItemAdv.OnMouseLeftButtonDown(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonDown(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

Line: 54
Char: 13
Code: 0
URI: file:///C:/Users/Keith/Documents/Visual%20Studio%202010/Projects/Sync9MenuTest/Sync9MenuTest/Bin/Debug/Sync9MenuTestTestPage.html

Keith Reimer
Replied On February 16, 2011 12:14 AM UTC

I attached a simple repro project to demonstrate.


Keith Reimer
Replied On February 22, 2011 03:30 AM UTC

Can someone take a look at this please? It will soon be a blocking issue for us. Thanks!

Sakthi Kumar A [Syncfusion]
Replied On February 23, 2011 10:03 AM UTC

Hi Keith,

We are able to reproduce the MenuItemAdv command binding issue and we have logged a defect report internally. We have also created a new incident #77537 in our Direct-Trac system, so that we would be able to share the patch details with you. Please refer to the Direct – Trac incident for any further inquiries.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon