在 windows 窗体上,所有文本框和组合框都是从 acctPackageBindingSource 绑定的。我在仅显示 int 值的组合框中绑定的问题意味着它来自 acctPackage 。我想显示名称意味着该值的“显示成员”。那个来自不同的表名是sysCode。那么如何才能完美地显示显示成员。下面是我的代码
// Here the all value is coming form Syscode table .
public void FillDropDown()
{
if (_commonComponent == null)
_commonComponent = new CommonComponent();
List<SysCode> _syscode = _commonComponent.GetByTableCodeForIncomeDedMapping("19");
bindingSourceSysCode.DataSource = _syscode;
packageCodeComboBox.DataSource = bindingSourceSysCode;
packageCodeComboBox.DisplayMember = "Desclong2";
packageCodeComboBox.ValueMember = "PackageCode";
}
//This part is bind my all value on the form
private void FillAcctPackage()
{
if (_commonComponent == null)
_commonComponent = new CommonComponent();
acctPackageBindingSource.DataSource = _commonComponent.GetAcctPackge();
}