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?
Thanks,
Keith
KR
Keith Reimer
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
KR
Keith Reimer
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!
SK
Sakthi Kumar A
Syncfusion Team
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.
Regards,
Sakthi