Problem with dynamic data

4 posts, 0 answers
  1. Philippe Laval
    Philippe Laval avatar
    3 posts
    Member since:
    Jan 2010

    Posted 14 Dec 2016 Link to this post

    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 ?

     

  2. Philippe Laval
    Philippe Laval avatar
    3 posts
    Member since:
    Jan 2010

    Posted 14 Dec 2016 in reply to Philippe Laval Link to this post

    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 ?
  3. Yana
    Admin
    Yana avatar
    4564 posts

    Posted 15 Dec 2016 Link to this post

    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.
  4. Philippe Laval
    Philippe Laval avatar
    3 posts
    Member since:
    Jan 2010

    Posted 15 Dec 2016 Link to this post

    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

     

Back to Top