自定义搜索上的 Silverlight AutoCompleteBox
我有这个对象:
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string FullName
{
get { return string.Format("{0} {1}", FirstName, LastName); }
}
public override string ToString()
{
return "Person " + LastName;
}
}
这个集合:
public ICollection<Person> Persons { get; set; }
我的 AutoCompleteBox 是:
<sdk:AutoCompleteBox ItemsSource="{Binding Persons}" FilterMode="Contains"
SelectedItem="{Binding EmployeeSelected,Mode=TwoWay}"
MinimumPrefixLength="2"/>
当我在 Persons 集合中搜索时,我想按名字搜索? AutoCompleteBox 中用于按名字搜索的属性是什么?
I have this object :
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string FullName
{
get { return string.Format("{0} {1}", FirstName, LastName); }
}
public override string ToString()
{
return "Person " + LastName;
}
}
And this Collecion:
public ICollection<Person> Persons { get; set; }
My AutoCompleteBox is :
<sdk:AutoCompleteBox ItemsSource="{Binding Persons}" FilterMode="Contains"
SelectedItem="{Binding EmployeeSelected,Mode=TwoWay}"
MinimumPrefixLength="2"/>
When i search in the Persons collection i want search by FirstName?
Which is the property in AutoCompleteBox for say search by FirstName?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 ValueMemberPath :
Use
ValueMemberPath
: