Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Docking > RadPane Context Menu

Not answered RadPane Context Menu

Feed from this thread
  • Hardik avatar

    Posted on Jan 31, 2012 (permalink)

    Hi,

    I am trying to add a custom context menu item (Setting) in a RadPane dock control MenuItem.

    I am stuck at to attached the custom contextMenu item.

    Following is the code which I did :

     public class ViewPartSettingMenuCommand : RoutedUICommand
      {  
        public ViewPartSettingMenuCommand() :
          base("Settings""ViewPartSettingMenuCommand"typeof(ViewPartSettingMenuCommand))
        {
        }
      }
    
    In the constructor of the view :
    
     CommandManager.SetCommandBindings(thisthis.GetCommandBindings());
    
     public CommandBindingCollection GetCommandBindings()
        {
          CommandBindingCollection bindings = new CommandBindingCollection();
          bindings.Add(new CommandBinding(this.Resources["ViewPartSettingMenuCommand"as ViewPartSettingMenuCommandthis.OnViewPartSettingMenuCommandExecute));
          return bindings;
        }
    
    In the resources :
    <DataTemplate x:Key="XamlContextMenu">
                <telerik:RadContextMenu>
                    <telerik:RadMenuItem Header="Floating"
                                                   Command="telerik:RadDockingCommands.Floating" />
                    <telerik:RadMenuItem Header="Dockable"
                                                   Command="telerik:RadDockingCommands.Dockable" />
                    <telerik:RadMenuItem x:Name="ViewPartSettingMenuCommand" />
                </telerik:RadContextMenu>
            </DataTemplate>
    in the RadPane :
    <telerik:RadPane x:Name="XamlPane" CanFloat="False" ContextMenuTemplate="{StaticResource XamlContextMenu}">
                                
    I have referred the following link:
    http://www.telerik.com/help/silverlight/raddocking-how-to-add-menu-items-to-the-radpanes-menu.html

    Thanks
    H@rdik Pancholi

    Reply

  • Konstantina Konstantina admin's avatar

    Posted on Feb 3, 2012 (permalink)

    Hello,

    Could you please share with us what difficulties do you experience: the menu is not showing, the commands are not working, or something else. If you could send us some more code related to the issue it will be helpful for tracking down the source of the issue.

    Greetings,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Hardik avatar

    Posted on Feb 6, 2012 (permalink)

    Hi,

    When I am binding the command "CommandManager.SetCommandBindings(thisthis.GetCommandBindings()); ",

    I am getting an exception :

    "Value cannot be null.
    Parameter name: command"

    Thanks.
    H@rdik Pancholi.

    Reply

  • Boyan Boyan admin's avatar

    Posted on Feb 7, 2012 (permalink)

    Hi,

    We have answered in your support thread however I will post the modified project here as well if someone else needs it.

    Greetings,
    Boyan
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Docking > RadPane Context Menu
Related resources for "RadPane Context Menu"

Silverlight Docking Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]