This is a migrated thread and some comments may be shown as answers.

Problem with dynamic data

3 Answers 117 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Philippe Laval
Top achievements
Rank 1
Philippe Laval asked on 14 Dec 2016, 11:49 AM

Basically I try to follow the example :

http://docs.telerik.com/devtools/wpf/controls/radchart/how-to/howto-integration-radcontextmenu-wpf

 

I use an ItemTemplate not to see the base class used for dynamic item

<telerik:RadContextMenu x:Name="RadContextMenu"
                                        ItemTemplate="{StaticResource MenuItemTemplate}"
                                        ItemClick="OnContextMenuClick">

 

defined like this

HierarchicalDataTemplate x:Key="MenuItemTemplate"
                                  DataType="{x:Type local:ContextMenuItem}"
                                  ItemsSource="{Binding Items}">
            <TextBlock Text="{Binding Text}" />
        </HierarchicalDataTemplate>

 

I have a problem applying the <telerik:RadContextMenu.ItemContainerStyle> : the menu disappears.

In the attached example, I can see the context menu when no style is applied but I can not apply the settings like separator item.

How can I have this example working with Telerik 2016.3.1024.45.NoXaml ?

 

3 Answers, 1 is accepted

Sort by
0
Philippe Laval
Top achievements
Rank 1
answered on 14 Dec 2016, 03:46 PM
I have found the problem in your dll and a work around:
The upgrade wizzard try to use references like this : lib\RCWPF\2016.3.1024.45.NoXaml
and then you must choose a theme (VS2013, etc.)
The problem is that every context menu sample will fail (I mean not the plain ones with fixed menu context items).
I remove every dll references and choosed the dll from C:\Program Files (x86)\Telerik\UI for WPF R3 2016\Binaries\WPF45. I also removed the references to theme in app ressources.
Then bingo : the sample worked with the plain yellow look& feel.
So I suspects you have problem with themes or dll with xaml.
How can we use the themes ?
0
Yana
Telerik team
answered on 15 Dec 2016, 12:08 PM
Hi Philippe,

When you are using the Upgrade Wizard, it references our NoXaml binaries and uses Implicit Styles to set the selected theme as this is the recommended approach of applying a theme to our WPF controls. 

This, however, requires to base the custom Styles you have on the default ones. So, in the concrete case, ItemContainerStyle property of the RadMenu sets the Style of RadMenuItem, so you will have to base it on the default RadMenuItemStyle like this:

Copy Code
<Style TargetType="telerik:RadMenuItem" BasedOn="{StaticResource RadMenuItemStyle}">

I hope this helps.

Regards,
Yana
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Philippe Laval
Top achievements
Rank 1
answered on 15 Dec 2016, 03:04 PM

Thanks for your quick answer. It is now working perfectly.

Good to know that we have to base our style on the Telerik one's.

Regards

Philippe Laval

 

Tags
ContextMenu
Asked by
Philippe Laval
Top achievements
Rank 1
Answers by
Philippe Laval
Top achievements
Rank 1
Yana
Telerik team
Share this question
or