[英]Binding to the ItemSource
I'm trying to build dynamically a AutoCompleteBox.我正在尝试动态构建一个 AutoCompleteBox。 Then I want to use a list of Clients in my itemsource, and the user visualize the DescClient field.然后我想在我的项目源中使用客户列表,并且用户可视化 DescClient 字段。
List<Client> clients = ClientAction.getClientsFromUsers(Environment.UserName);
(field as AutoCompleteBox).ItemsSource = clients;
//CLIENT MEMBERS
private int idClient;
private string descClient;
private int idGroup;
private User user;
Already tried like:已经尝试过:
(field as AutoCompleteBox).ValueMemberPath = "DescClient"
But doesn't show anything.但是什么都不显示。 Am I doing something wrong afecting the ValueMemberPath or should I use another Proprety?我是否在影响 ValueMemberPath 时做错了什么,还是应该使用其他属性?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.