This is a migrated thread and some comments may be shown as answers.
RadContextMenu with RadCalendar
1 Answer 97 Views
This is a migrated thread and some comments may be shown as answers.
Paul Gallen
Top achievements
Rank 1
Paul Gallen asked on 12 Nov 2008, 10:14 AM

Hi

With regards to the RadContextMenu documentation it states:

"You can attach RadContextMenu to any UI element on your page. All you have to do is create your object, put a RadContextMenu inside its closing tags and define the event that will open the context menu".

I tried this with the RadCalendar, and VS complained stating:The RadCalendar does not support direct Content.

Sorry Iam am new to XAML, so a bit confused. Isn't the RadCalendar a UI element?

Thanks Paul


1 Answer, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 13 Nov 2008, 01:12 PM
Hello Paul Gallen,

RadContextMenu have attached property ContextMenu that you should set in order to attach RadContextMenu. Here is an example on how to do it.

<UserControl x:Class="SilverlightApplication15.Page" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:nav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
        xmlns:inp="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" 
        Width="400" Height="300">  
    <Grid x:Name="LayoutRoot" Background="White">  
        <inp:RadCalendar> 
            <nav:RadContextMenu.ContextMenu> 
                <nav:RadContextMenu EventName="SelectionChanged">  
                    <nav:RadMenuItem Header="File">  
                        <nav:RadMenuItem Header="New" /> 
                        <nav:RadMenuItem Header="Exit" /> 
                    </nav:RadMenuItem> 
                    <nav:RadMenuItem Header="Edit">  
                        <nav:RadMenuItem Header="Cut" /> 
                        <nav:RadMenuItem Header="Copy" /> 
                        <nav:RadMenuItem Header="Paste">  
                            <nav:RadMenuItem Header="With tags" /> 
                            <nav:RadMenuItem Header="Text Only" /> 
                        </nav:RadMenuItem> 
                    </nav:RadMenuItem> 
                    <nav:RadMenuItem Header="Help">  
                        <nav:RadMenuItem Header="About" /> 
                    </nav:RadMenuItem> 
                </nav:RadContextMenu> 
            </nav:RadContextMenu.ContextMenu> 
        </inp:RadCalendar> 
    </Grid> 
</UserControl> 

If you have more questions, I'll be glad to help.


Sincerely yours,
Hristo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Menu
Asked by
Paul Gallen
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or