views:

817

answers:

1

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  A: 

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).

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