question

Heiko-6891 avatar image
0 Votes"
Heiko-6891 asked Heiko-6891 commented

Character Handler in WPF

Hi,

I would like to jump in a ListView (GridView) by entering letters to the entry that starts with these letters in the first column. Unfortunately, this does not already happen automatically. Therefore I wanted to implement it myself.

But I notice that neither the ListView nor the Window have a CharacterReceived event. The KeyUp handler is also inappropriate, since it only returns keys from an enumeration, but not letters of arbitrary scripts (Cyrillic, Arabic, etc.).

Now how can I implement this?

In UWP there is CoreWindow.GetForCurrentThread().CharacterReceived, what in WPF?

windows-wpfdotnet-wpf-xaml
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

does protected override void On[Preview]TextInput work?

0 Votes 0 ·

I now use TextSearch in the ListView. OnTextInput() returns the desired character in each case. I will probably use OnTextInput() in the TreeView.

Thank you.

1 Vote 1 ·

If you work with large/moderate dataset/database, at some point you definitely will want to have functionalities provided by ICollectionView, have a look at that. For both columnar and hierarchical dataset you can use that with a ListBox. For tree like structure you'll have to provide a Group Style with expander and for columnar set a DataTemplate. It's nice built in filter, sort, grouping capabilities.

0 Votes 0 ·
Show more comments

0 Answers