TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abdusalam Elsherif
NA
43
572
How to make WPF AutoCompleteBox accept more than one Propert
Jun 24 2018 2:47 AM
I want to search in multiple fields in AutoCompleteBox, I want to search in ClientName if the user starts typing characters, and search in ClientNumber if the user starts typing numbers.
I searched on the internet and from this Answer I understand that I should use Converter to accomplish what I want, But unfortunately, they do not explain how can I write the converter!
<
toolkit:AutoCompleteBox
x:Name
=
"txbClientName"
FilterMode
=
"StartsWith"
IsTextCompletionEnabled
=
"True"
ItemsSource
=
"{Binding ocClients}"
ValueMemberBinding
=
"{Binding Converter= {StaticResource ClientSearch}}"
SelectedItem
=
"{Binding ElementName=this, Path=ContactPerson, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
PreviewKeyUp
=
"txbClientName_PreviewKeyUp"
LostFocus
=
"txbClientName_LostFocus"
>
<
toolkit:AutoCompleteBox.ItemTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Label
Content
=
"{Binding ContactPerson}"
/>
</
StackPanel
>
</
DataTemplate
>
</
toolkit:AutoCompleteBox.ItemTemplate
>
public
class
ClientSearchConverter : IValueConverter
{
public
object
Convert(
object
value, System.Type targetType,
object
parameter, System.Globalization.CultureInfo culture)
{
//What should I write here !!!
}
public
object
ConvertBack(
object
value, System.Type targetType,
object
parameter, System.Globalization.CultureInfo culture)
{
throw
new
System.NotImplementedException();
}
}
Any Help
Reply
Answers (
0
)
Scalability test, what does it mean?
AccessSpecifier