9

I have a data-bound ListBox with an ItemTemplate which i want to enable keyboard navigation on.

If i didn't use an item template and just used the DisplayMemberPath then the list would be navigable with the keybaord. Pressing 'G' for example, would set the selected item to the first listitem beginning with G. Using an item template obviously makes that more difficult since there are zero or more textual candidates for such navigation in the template.

My question is how can i either mark an element as the navigation source or mock this effect using other methods?

1 Answer 1

12

This is possible if you have a textual property that you want to navigate by:

<ListBox TextSearch.TextPath="Name" ... /> 

Point TextSearch.TextPath at the property you want to enable keyboard-lookup on ("Name" in this example).

Sign up to request clarification or add additional context in comments.

2 Comments

On the button every time Matt. Cheers dude.
I found this one out from a commenter on my blog! It's not very well documented.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.