문제

i am trying to customize the suggestions on the AutoCompleteBox in the WPF Tool kit. Right now i have a last name field which when the user enters characters a query runs that retrieves the top 10 records based on that last name. i would also like to filter by first name, i tried splitting out the comma and searching by the last name and the characters entered in the first name.

however, as soon as a space or comma is entered into the autocompletebox, the suggest functionality stops working, which I believe is because the ValueMemberPath property is set to be last name. Is there a work around for this, or a way to modify the ValueMemberPath to handle multiple values? Thanks!

도움이 되었습니까?

해결책

If you wont get any satisfied answer there's a nice control that I'm using from codeproject that supports searching by keywords with easy API.

WPFAutoCompleteTextbox

다른 팁

There's another simple way to get Autocompletebox accept more than one Property for filtering: just use ValueMemberBinding like this:

ValueMemberBinding="{Binding Converter={StaticResource myConverter}}"

and define "myConverter" so that it concatenates your filter properties (properly separated) into a single string; now your AutocompleteBox will use the whole string as it was a single property.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top