RadContextMenu positioning when when used with RightClick

5 posts, 0 answers
  1. John
    John avatar
    6 posts
    Member since:
    Nov 2008

    Posted 06 Nov 2008 Link to this post

    We've just started using RADControls for Silverlight nad have replaced our previous home grown menu with the RADContextMenu to handle RightClick context sensitive menu. Our  only problem is placment we need to know the size of the rendered control in order to set the intial position of the control so the bottom right corner is located where the mouse click occured. The right click is trapped by overlaying the SilverLight control with a transparent DIV and then generating a fake RightClickEvent from JavaScript for SilverLight to handle, this opens and posistions a Popup containing the RADContextMenu.

    Can we determine the rendered size at this point or is there a better way to load and position the control.


    Thanks in advance for any advice


  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 06 Nov 2008 Link to this post

    Hi John,

    RadContextMenu support Absolute, Bottom, Center, Right, Left and Top positioning through Placement property. The default value is Absolute and menu top left corner is positioned where the mouse is located.
    RadContextMenu also support MouseRightButtonDown event (and this is the default event) but for this event to work you should run Silvelight 2 in windowless mode (keep in mind that this can significantly decrease you application performance).
    You can set EventName property to any event that is thrown by the control the has ContextMenu (for example MouseLeftButtonDown, Click - for buttons, etc.). For more information you can check the help file.
    The ContextMenu have Opened routed event so you can attach to it, get the RenderSize and move the ContextMenu using HorizontalOffset and VerticalOffset. This way you can achieve bottom right corner placement.

    Hope this helps. If you have more question I'll be glad to help.


    Regards,
    Hristo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Voss Grose
    Voss Grose avatar
    81 posts
    Member since:
    Sep 2012

    Posted 17 Jul 2009 Link to this post

    Is there an event for Mouse Double Click?
  5. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 22 Jul 2009 Link to this post

    Hi Voss Grose,

    It is not supported by RadContextMenu.In fact there is no event  DoubleClick in Silverlight . You can not set EventName to be DoubleClick. You can create custom DoubleClick  by custom code as is shown in this thread. And then you can add handler to the event and try to attach RadContextmenu to it. It can work but such a scenario is not tested, so i can't guarantee this workaround will work properly. You can give it a try and hopefully it will work properly. If you need more help please let me know.

    Best wishes,
    Boyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. scvn80
    scvn80 avatar
    8 posts
    Member since:
    Sep 2009

    Posted 21 Aug 2013 Link to this post

    Sorry I post wrong thread.
Back to Top
DevCraft banner