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

Telerik documentation for context menu is missing very important thing

1 Answer 115 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Mateusz
Top achievements
Rank 1
Mateusz asked on 13 Feb 2018, 10:29 AM

Hi,

Teleriks outdated documenation caused me, again, to lose some time finding solution.

https://docs.telerik.com/devtools/wpf/controls/radcontextmenu/how-to/use-radcontextmenu-with-radgridview

Here is implementation of RadContextMenu for RadGridView, step-by-step guide is clear and explains everything. But menu implemented in this way to my app didn't work. There is important property, not present in documentation:

BasedOn="{StaticResource RadMenuItemStyle}"

wwich changes Example 4

<Style x:Key="MenuItemContainerStyle" TargetType="telerik:RadMenuItem">
    <Setter Property="Header" Value="{Binding Text}"/>
    <Setter Property="ItemsSource" Value="{Binding SubItems}"/>
    <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
</Style>

to

 

<Style x:Key="MenuItemContainerStyle"
                   TargetType="telerik:RadMenuItem"
                   BasedOn="{StaticResource RadMenuItemStyle}">
                <Setter Property="Header"
                        Value="{Binding Text}" />
                <Setter Property="ItemsSource"
                        Value="{Binding SubItems}" />
                <Setter Property="IsEnabled"
                        Value="{Binding IsEnabled}" />
            </Style>

 

Please, update your documentation to save others time. 

 

Best Regards,

Mateusz

 

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 15 Feb 2018, 04:29 PM
Hello Mateusz,

Thank you for your feedback. 

Let me explain the reason for the styles being defined without the BasedOn property. Setting that property is only required if you are using the NoXaml binaries with implicit styles. In that case you need to base your style on the theme's default one as described in the Styling the Controls article. If you are using the Xaml binaries, there is no need for setting the BasedOn property.

Regards,
Vladimir Stoyanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ContextMenu
Asked by
Mateusz
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or