Search menu items by typing in chars

2 posts, 0 answers
  1. Jannk
    Jannk avatar
    23 posts
    Member since:
    Jul 2014

    Posted 18 Mar 2015 Link to this post

    I have the following XAML-code:


    <telerik:RadMenu Grid.Row="2"
                             Grid.Column="1"
                             Margin="-6,0,0,0"
                             VerticalAlignment="Center"
                             Background="Transparent"
                             ClickToOpen="True"
                             IconColumnWidth="0">
                <telerik:RadMenuItem x:Name="KontextRadMenuItem" StaysOpenOnClick="True">
                    <telerik:RadMenuItem.Header>
                        <TextBlock Foreground="DarkBlue" Text="{Binding SelectedKontextText}" />
                    </telerik:RadMenuItem.Header>
                    <telerik:RadMenuGroupItem IsCheckable="True"
                                              ItemTemplate="{StaticResource MenuTemplate}"
                                              ItemsSource="{Binding KontextAuswahlList}"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              MaxHeight="300"
                                              Padding="-5,-5,-5,-5"
                                              StaysOpenOnClick="True"
                                              cal:Message.Attach="[Event Checked] = [Action KontextHinzufuegen($source,$eventArgs)]; [Event Unchecked] = [Action KontextEntfernen($source,$eventArgs)];[Event KeyDown] = [Action KontextAuswahlKeyDown($source,$eventArgs)]" />
                    
                </telerik:RadMenuItem>
            </telerik:RadMenu>

    My menu has around 300 menu items. How do I let the user type some chars, e.g. just the letter P, to jump to the first occurance starting with a P? Is there SearchPath, which i can set to SelectedContextText? Or something similar?
  2. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 23 Mar 2015 Link to this post

    Hi Jannk,

    I'm afraid that the control doesn't support the desired functionality. What you can try would be to use RadListBox in RadMenuGroupItem and use its TextSearchMode to navigate through the items. However this suggestion might not be suitable for every scenario (for example: if you have nested MenuItems inside of the GroupItem).

    Hope this helps.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
Back to Top