I have a RadTreeview with a RadTreeViewContextMenu. The RadTreeViewContextMenu should be the same thing as a RadContextMenu correct?
So I'm trying to do two things here.
1) Display the context menu using the keyboard. Preferably [Shift] + [F10].
2) Set Focus on the context menu when it displays, so I can navigate through it with the keyboard.
I've attempted at setting focus to the menu first and it just would not work for me. Giving the focus to the menu in the event OnClientContextMenuShown, gets me this javascript error saying "Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus." I've tried setting the menu to display, setting it to enabled, and none of those work, so is this menu of a type that does not accept focus?
Here is my code
Javascript
Markup
Thanks in advance.
Kai Thao
So I'm trying to do two things here.
1) Display the context menu using the keyboard. Preferably [Shift] + [F10].
2) Set Focus on the context menu when it displays, so I can navigate through it with the keyboard.
I've attempted at setting focus to the menu first and it just would not work for me. Giving the focus to the menu in the event OnClientContextMenuShown, gets me this javascript error saying "Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus." I've tried setting the menu to display, setting it to enabled, and none of those work, so is this menu of a type that does not accept focus?
Here is my code
Javascript
function onClientContextMenuShown(sender, args) |
{ |
args.get_menu().focus(); |
} |
Markup
<telerik:RadTreeView ID="Favorites" runat="server" EnableEmbeddedSkins="False" Skin="KMNetYellow" Width="220px" EnableViewState="false" |
OnClientContextMenuShowing="onClientContextMenuShowing" |
OnClientContextMenuShown="onClientContextMenuShown" |
OnClientContextMenuItemClicked="onFavoriteFolderMenuClicked" |
OnClientNodeEditStart="OnClientNodeEditStartHandler" |
OnClientNodeEdited="OnClientNodeEditEndHandler" |
OnClientNodeExpanding="OnClientNodeExpanding" |
OnClientNodeCollapsing="OnClientNodeCollapsing"> |
<ContextMenus> |
<telerik:RadTreeViewContextMenu ID="objFavoritesMenu" runat="server" EnableEmbeddedSkins="False" Skin="KMNetGray" EnableViewState="false"> |
<Items> |
<telerik:RadMenuItem runat="server" Text="New Folder" Value="NewFolder" EnableViewState="false"> |
</telerik:RadMenuItem> |
<telerik:RadMenuItem runat="server" IsSeparator="True" Text="----------" EnableViewState="false"> |
</telerik:RadMenuItem> |
<telerik:RadMenuItem runat="server" Text="Copy To ..." Value="Copy" EnableViewState="false"> |
</telerik:RadMenuItem> |
<telerik:RadMenuItem runat="server" Text="Move To ..." Value="Move" EnableViewState="false"> |
</telerik:RadMenuItem> |
<telerik:RadMenuItem runat="server" IsSeparator="True" Text="---------" EnableViewState="false"> |
</telerik:RadMenuItem> |
<telerik:RadMenuItem runat="server" Text="Delete" Value="Delete" EnableViewState="false"> |
</telerik:RadMenuItem> |
<telerik:RadMenuItem runat="server" Text="Rename" Value="Rename" EnableViewState="false"> |
</telerik:RadMenuItem> |
</Items> |
</telerik:RadTreeViewContextMenu> |
</ContextMenus> |
<DataBindings> |
<telerik:RadTreeNodeBinding ExpandedImageUrl="/images/icon_openfold.gif" EnableContextMenu="true" ImageUrl="/images/icon_clsdfold.gif"/> |
</DataBindings> |
</telerik:RadTreeView> |
Thanks in advance.
Kai Thao