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

how to Hide ContextMenu on mouseleave

5 Answers 269 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Jonx
Top achievements
Rank 2
Jonx asked on 16 Aug 2010, 12:45 AM
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 >

5 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 16 Aug 2010, 08:45 AM
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
0
Jonx
Top achievements
Rank 2
answered on 16 Aug 2010, 02:19 PM
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.
0
Accepted
Hristo
Telerik team
answered on 17 Aug 2010, 08:18 AM
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
0
Jonx
Top achievements
Rank 2
answered on 17 Aug 2010, 08:24 AM
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.
0
Hristo
Telerik team
answered on 18 Aug 2010, 07:47 AM
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
Tags
Menu
Asked by
Jonx
Top achievements
Rank 2
Answers by
Hristo
Telerik team
Jonx
Top achievements
Rank 2
Share this question
or