I currently have a RadGridView that I attach a context menu to. I subscribe to the ItemClick event and handle whatever was clicked in that method. This worked fine with RadControls for Silverlight Q2 2012, but after applying the RadControls for Silverlight5 2012 2 0813 hotfix, the functionality is partially broken.
The functionality I want still works in-browser, but when running the application out of browser (OOB), clicking anywhere or pressing keys on a keyboard after opening the context menu (by right clicking on the GridView) causes the context menu to close. The closed event is never fired after clicking on the context menu, it is only fired if I click outside of the context menu. The context menu opening event always gets hit, but the item clicked event is only triggered when the application is running in browser.
The only way I was able to keep the menu open and available to click on is by setting the ContextMenu property StaysOpen to true, but I do not want the menu to stay open like this. I checked the themes for the RadContextMenu and they look identical in both of these Telerik versions.
Here is an example of the code behind (the xaml contains of 1 gridview named 'grid'):
public
MainPage() {
InitializeComponent();
RadContextMenu contextMenu =
new
RadContextMenu();
contextMenu.Items.Add(
new
RadMenuItem { Header =
"Item 1"
});
contextMenu.Items.Add(
new
RadMenuItem { Header =
"Item 2"
});
contextMenu.Opening += ContextMenuOpeningHandler;
contextMenu.ItemClick += ContextMenuItemClickHandler;
RadContextMenu.SetContextMenu(grid, contextMenu);
}
private
void
ContextMenuItemClickHandler(
object
sender, RadRoutedEventArgs e) {
new
RadWindow { Content =
"Item Clicked!"
}.ShowDialog();
}
private
void
ContextMenuOpeningHandler(
object
sender, RadRoutedEventArgs e) {
Debug.WriteLine(
"Context Menu Opening"
);
}
Any help or suggestions would be greatly appreciated.
Thanks, Misha