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

Tab (key) navigation inside a context menu

3 Answers 118 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 27 Mar 2015, 08:32 PM
Hi there,

We are using RadContextMenu to pop up a small editor with several TextBoxes.  We would like our users to be able to navigate among the text boxes using the Tab key.  However, this doesn't work -- tab does nothing.

The following is a trivial example of a ContextMenu with three text boxes.  Click inside one TextBox and hit tab.  I would expect it to cycle among the three tabs.

How can we enable this behavior, please?

Thanks!

-David

<Window x:Class="telerik_context_menu_taborder.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Rectangle Fill="Black" Width="100" Height="50">
            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu KeyboardNavigation.TabNavigation="Cycle" >
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <TextBox Grid.Row="0" Text="TextBox1" />
                        <TextBox Grid.Row="1" Text="TextBox2" />
                        <TextBox Grid.Row="2" Text="TextBox3" />
                    </Grid>
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>
        </Rectangle>
    </Grid>
</Window>


3 Answers, 1 is accepted

Sort by
0
Accepted
Kalin
Telerik team
answered on 30 Mar 2015, 11:34 AM
Hello David,

What I can suggest you for this particular scenario would be to use RadMenuGroupItem instead in order to achieve the desired functionality:

<Rectangle Fill="Black" Width="100" Height="50">
    <telerik:RadContextMenu.ContextMenu>
        <telerik:RadContextMenu KeyboardNavigation.TabNavigation="Cycle">
            <telerik:RadMenuGroupItem>
                <Grid Margin="10">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBox Grid.Row="0" Text="TextBox1" />
                    <TextBox Grid.Row="1" Text="TextBox2" />
                    <TextBox Grid.Row="2" Text="TextBox3" />
                </Grid>
            </telerik:RadMenuGroupItem>
        </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>
</Rectangle>

Hope this helps.

Regards,
Kalin
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
David
Top achievements
Rank 1
answered on 30 Mar 2015, 04:44 PM
Thank you!  That works!

Can you comment on why it is the case that it would be necessary to enclose the content in a RadMenuGroupItem, please?  What does that add, change or override?
0
Kalin
Telerik team
answered on 31 Mar 2015, 02:17 PM
Hello David,

RadMenuGroupItem should be used when you simply need to display any UIElements straight forward. Basically the ContextMenu should contain MenuItems and this is suitable for cases when don't want show a RadMenuItem but other UIElements instead. For more details about the different MenuItems check here.

Hope this helps.

Regards,
Kalin
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
ContextMenu
Asked by
David
Top achievements
Rank 1
Answers by
Kalin
Telerik team
David
Top achievements
Rank 1
Share this question
or