Highlight Treeview Item on key strock

Using IsTextSearchEnabled property of tree view controls you can get highlight items whose first letter is equal to the key your have pressed

IsTextSearchEnabled 

This property Gets or sets a value that indicates whether TextSearch is enabled on the ItemsControl instance. (Inherited from ItemsControl.)

 <TreeView>
<TreeViewItem Header="Employee1">
<TreeViewItem Header="Jesper"/>
<TreeViewItem Header="Aaberg"/>
<TreeViewItem Header="12345"/>
</TreeViewItem>
<TreeViewItem Header="Employee2">
<TreeViewItem Header="Dominik"/>
<TreeViewItem Header="Paiha"/>
<TreeViewItem Header="98765"/>
</TreeViewItem>
</TreeView>

Use above code to create tree view control with answers and press Key 'E", you will see the treeview will highlight two time on Employee1 and Employee2

More details go to the following link


Ebook Download
View all
Learn
View all