Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
630
TextSearch.TextPath in MenuTool
posted

Hi,

I'm trying to use the TextSearch class in the MenuTool, but I can't make it work.

My current implementation:

<igRibbon:MenuTool
                    ButtonType="DropDown"
                    ItemsSource="{Binding Path=Container.Items}"
                    IsTextSearchEnabled="True"
                    TextSearch.TextPath="DisplayName">
...

DisplayName is a string property of my objects that are in the Container.Items collection.

What I'm trying to achive, is to make the ToolMenu jump to the next best item (bring it into view) that starts with the typed in string.

Is this possible? Does anybody have any working example for me?

Regards,

Darius

Parents
  • 34510
    Verified Answer
    Offline posted

    Hi Darius,

    The MenuTool is an ItemsControl which is how it gets the IsTextSearchEnabled property, but inside the MenuTool there is a MenuToolPresenter which is another ItemsControl and this is what actually contains the menu items.  The IsTextSearchEnabled property on MenuTool is not propagated down to MenuToolPresenter so you'll have to add a style with a setter for it.

    <Style TargetType="{x:Type igRibbon:MenuToolPresenter}">
        <Setter Property="IsTextSearchEnabled" Value="True"/>
        <Setter Property="TextSearch.TextPath" Value="DisplayName"/>
    </Style>

Reply Children
No Data