how to Hide ContextMenu on mouseleave

6 posts, 1 answers
  1. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 15 Aug 2010 Link to this post

    Hello,
    I have a context menu that shows up on my textblock MouseEnter. all good.

    What I want is that the menu hides when I leave the block. I thought the menu will just close itself after the hide delay runs out.

    Do I miss something? Thank you for your help.

    Also, one question. If I have bought the product can I ask such questions to the support by opening a ticket or do I still come here for answers?

    Here is my xaml:
    <TextBlock  x:Name="StoreLink" Text="Store" >
                                <telerik:RadContextMenu.ContextMenu>
                                    <telerik:RadContextMenu HorizontalAlignment="Left" Name="StoreContextMenu" VerticalAlignment="Top" EventName="MouseEnter" Placement="Bottom" HideDelay="0:0:1">
                                        <telerik:RadMenuItem Header="Par chaine" Click="RadMenuItem_Click" />
                                        <telerik:RadMenuItem Header="Par marque" Click="RadMenuItem_Click_1" />
                                        <telerik:RadMenuItem Header="Liste spécifique" Click="RadMenuItem_Click_2" />
                                    </telerik:RadContextMenu>
                                </telerik:RadContextMenu.ContextMenu>
                            </TextBlock >
  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 16 Aug 2010 Link to this post

    Hi John,

    This is not a supported scenario. When RadContextMenu opens we open two popups - one to catch all clicks outside the menu and one for the menu itself. So TextBlock receive MouseLeave immediately (when first popup open) and in your case menu will never show.
    HideDelay will work if ClickToOpen is set to False - default value is True and cannot be set through Style.

    Let us know if you need more information.

    Kind regards,
    Hristo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 16 Aug 2010 Link to this post

    Hum, yes... please.

    what I want is that the menu shows when I hover over a specific element, here a textblock.

    The  if my mouse goes somewhere else on the screen without selecting a menu entry, I want the menu to hide automatically after a while.
    How can I do that? Now, the menu stays until I click somewhere else on the screen...

    thank you for your help.
  5. Answer
    Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 17 Aug 2010 Link to this post

    Hello John,

    The menu will close only when you leave the context menu. If you have never entered it will not close.
    RadContextMenu was not designed to work as RadMenu with ClickToOpen=False. As an alternative you can use Popup control and manually open/close it based on your requirements.

    Let us know if we can help you further.

    Greetings,
    Hristo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 17 Aug 2010 Link to this post

    Thank you for your help Hristo.

    You are right I will have to find another way...
    I'm probably wrong from the start...

    All I wanted was a dropdown menu when I move over a control. Is there any other candidate control that you could recommand?

    Thanks again.
  7. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 18 Aug 2010 Link to this post

    Hi John,

    I guess you could use RadDropDownButton and set its HoverDelay to 00:00:00 duration so that the DropDown opens on mouse enter.

    I hope that this will help you.

    Regards,
    Hristo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner