0
我有一個ComboBox,在ItemsSource上綁定了一個實體ObservableCollection。就像這樣:WPF可編輯組合框文本搜索行爲
Key Desc1 Desc2
C0001 myDesc myDesc
D0001 myDesc myDesc
A0001 myDesc MyDesc
組合框是這樣定義的:
<ComboBox
IsEditable=True
DisplayMemberPath="Key"
SelectedValuePath="Key"
ItemsSource="{Binding Path=MyList, Mode=OneWay}" />
現在我有這個問題...
如果我鍵入組合框的空編輯文本字符,第一個元素該「開頭」鍵入的字符匹配。所以,如果我輸入「C」,選定的項目是元素「C0001」...我會避免這個!
我會找到基於全文輸入的selecteditem不同的搜索邏輯。這樣:
Text Typed SelectedItem
C null
C0 null
C00 null
C000 null
C0001 [C0001, myDesc, myDesc] OK!
可能嗎?我能怎麼做?
問題是關於WPF不Winforms! – 2011-01-25 09:51:10