Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Listbox item searching using keyboard

Tags:

c#

wpf

xaml

listbox

I have a Listbox control in my XAML window which will show around 500 items at runtime.I need to navigate through this items using keyboard like Windows Explorer. For example in Windows Explorer, when we type a key "a" it will automatically select an item which start with the key a. This will provide more usability to user. Does anyone know how to solve this? Thanks in advance

like image 310
nimisha Avatar asked Nov 26 '25 06:11

nimisha


1 Answers

You can solve this issue using "TextSearch.TextPath". Name should be the property you want to navigate through the Listbox.

<ListBox TextSearch.TextPath="Name" IsTextSearchEnabled="True"/>
like image 166
Vimal CK Avatar answered Nov 28 '25 20:11

Vimal CK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!