【发布时间】:2017-09-09 22:39:58
【问题描述】:
自从我尝试将 itemsource 设置为等于 datagrid 项目源以来 只想显示一次“un”属性。我还在 xaml 中为组合框设置了绑定属性,并返回类引用。调试时它正确设置了显示成员路径,但是当我运行它时它没有显示在组合框中。
private void dgViewCBIData_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
cbi= (CBICalculate)dgViewCBIData.SelectedItem;
txtName.Text = cbi.Name.ToString();
txtHeight.Text = cbi.He.ToString();
txtWeight.Text = cbi.We.ToString();
cmbUnits.DisplayMemberPath = cbi.Un;
}
【问题讨论】: