It is not closing after click. Do i have to close it manually?
We are using Telerik.Windows.Controls.dll file version 2011.1.315.40.
Thanks
Ram
12 Answers, 1 is accepted
We are not aware of such issue. Could you please try to reproduce it in a sample project and send it to us. In that way we will be able to track down the source of the problem and provide you with solution.
Looking forward to your reply.
Best wishes,
Konstantina
the Telerik team
Cheers,
Mike
It would be nice if you added a GridContextMenu.Close() method.
Cheers,
Mike
We are glad that the issue is resolved.
We will consider adding such property if we receive enough clients' requests.
All the best,
Konstantina
the Telerik team
The problem arises when you have a menu item that takes you through a progression of states. If the user accidently presses the mouse button twice, without a menu close mechanism, two events will be triggered instead of one.
This is a significant issue. Using Q2 2012
I have logged this feature request in PITS, where you could vote for it and track its status. The more votes it receives the sooner it will be implemented.
Kind regards,
Konstantina
the Telerik team
this.IsOpen = false;
I'd added a textbox and a button to the control and needed to close the context menu when the button was pressed.
This is my full button click event if it helps anyone:
void ButtonSet_Click(object sender, RoutedEventArgs e)
{
Button b = (Button)sender;
StackPanel stack = b.GetVisualParent<StackPanel>();
TextBox tb = stack.ChildrenOfType<TextBox>().First();
int value;
if (int.TryParse(tb.Text, out value))
{
... code to process int ...
this.IsOpen = false;
}
}
RadContextMenu will be closed when you click outside of it or when you click on one of its RadMenuItems. If you have added a button inside RadMenuItem, when you click it, you have to manually close RadContextMenu by setting its IsOpen property to false, as you have mentioned in your post.
Hope this helps. Feel free to contact us in case you have any problems or concerns.
Regards,
Rosen Vladimirov
Telerik
Hi, I am having an opposite issue where I want to force RadContextMenu to stay open. I am attempting to implement DragDropManager to allow users to reorder RadMenuItems as per https://docs.telerik.com/devtools/wpf/controls/dragdropmanager/getting-started .
However, when I begin to drag a RadMenuItem the RadContextMenu closes automatically. I believe this is because setting AllowCapturedDrag to true says that the dragged item will steal mouse capture. Interestingly enough the RadContextMenu.LostMouseCapture event never fires.
My first thought was to subscribe to RadContextMenu.Closing event and set the EventArgs.Handled = true. However, despite having Opening, Opened, and Closed events, a Closing event doesn't exist. Do you have any suggestions for a workaround?
Perhaps I am missing something, but in order for the RadContextMenu to stay open after an item has been clicked, you can set its StaysOpen property to "True". Can you give this a try and let me know if it is suitable for your scenario?
Regards,
Vladimir Stoyanov
Progress Telerik
Vladimir, thanks for responding.
I have StaysOpen set to true. However, beginning to drag menu items doesn't count as a click I suppose because the RadContextMenu automatically closes. Essentially once I hold down on a menu item and begin to drag it, the context menu thinks I clicked off the menu and it closes.
Thank you for the additional information.
I researched the described scenario some more and you are indeed correct that the dragged item is taking mouse capture. The LostMouseCapture event is not fired since it is handled in the MenuBase class from which the RadContextMenu inherits. That event handler is responsible for closing the menu when the mouse capture is lost. Bearing this in mind I am afraid that it is not possible to reorder the RadContextMenu items using the DragDropManager.
Regards,
Vladimir Stoyanov
Progress Telerik