this
.comboBox1.ItemsSource = List<> ;
this.comboBox1.DisplayMemberPath = "Remark";
this.comboBox1.SelectedValuePath = "WorkRecordID";
string strID = comboBox1.SelectedValue.ToString();
本文介绍如何在WPF应用程序中使用C#为ComboBox设置数据源,并指定显示成员与选择值路径。通过简单的代码示例,展示了如何从列表中获取选定项的ID。
this
.comboBox1.ItemsSource = List<> ;
this.comboBox1.DisplayMemberPath = "Remark";
this.comboBox1.SelectedValuePath = "WorkRecordID";
string strID = comboBox1.SelectedValue.ToString();

被折叠的 条评论
为什么被折叠?