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

Binding and Sub-MenuItems - How to get the events?

Thread ID:





128283 Jan 12,2017 10:30 AM UTC Jan 18,2017 11:05 AM UTC UWP 1
Tags: SfMenu
Gernot Knes
Asked On January 12, 2017 10:30 AM UTC

Based on my forum entry 127366 (https://www.syncfusion.com/forums/127366/binding-and-sub-menuitems) I´m now able to bind menu-items and sub-menu-items to collections in ViewModels or code behind.
I´m now struggling with the problem how to get the event when a sub-menu-item is clicked?

I tried two approaches:

Trigger the tapped event in my DataTemplate:

        <DataTemplate x:Key="MenuItemInnerTemplate">
            <Grid Tag="{Binding}" Tapped="MenuItemTapped">
                <TextBlock Text="{Binding Label}"/>
        <primitives:HierarchicalDataTemplate ItemsSource="{Binding SubMenuItems}" x:Key="MenuItemTemplate" Template="{StaticResource MenuItemInnerTemplate}">
                <primitives:HierarchicalDataTemplate ItemsSource="{Binding SubMenuItems}" Template="{StaticResource MenuItemInnerTemplate}"/>

<navigation:SfMenu Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top"
                       ItemTemplate="{StaticResource MenuItemTemplate}"/>

In Code behind I´m setting the ItemsSource to a ObservableCollection of my model.
In the Tapped-Event handler I´m reading the Tag property and therefor get the assigned element from my collection.

Works for the first layer, but NOT for submenu items. Here I do not get the tapped event from my Grid control.

Second try:

In code behind when the SfMenu control is Loaded I´m trying to get the realized SfMenuItem controls via the VisualTree. But also cant get the correct submenu items.

I´m pretty sure that I´m missing something. Could you please give me an advise how to solve this problem?

Thanks in advance and best regards, Gernot

Marimuthu Sivalingam [Syncfusion]
Replied On January 18, 2017 11:05 AM UTC

Hi Gernot

Thank you for contacting Syncfusion support.

We were able to reproduce the issue and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates


Marimuthu S.


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