我有一个组合框cboPrePartNum
:
- 数据源 - prepartBindingSource
- 显示成员 - PrePartNum
- 价值成员 - PrePartNum
- 选定值 - engordbindingsource - prepartnum
当表单加载时运行:
private void LoadComboBoxes()
{
List<PartPrevious> partPreviousList;
partPreviousList = PartDB.GetPartPreviousList();
cboPrePartNum.DataSource = partPreviousList;
cboPrePartNum.SelectedIndex = -1;
}
问题是当表单加载时,cboPrePartNum
组合框不显示当前在engordbindingsource.prepartnum
.
这就是 PartPrevious 的样子:
public class PartPrevious
{
private string prepartnum;
private string prerevision;
private string prepartdescription;
public PartPrevious() { }
public string PrePartNum
{
get { return prepartnum; }
set { prepartnum = value; }
}
public string PreRevision
{
get { return prerevision; }
set { prerevision = value; }
}
public string PrePartdescription
{
get { return prepartdescription; }
set { prepartdescription = value; }
}
}