private void ShopList(Dictionary<string, ShopInfo> shopLists, ComboBox comboBox, string shopCode)
{
if ((shopLists != null) && (shopLists.Count != 0))
{
var item = new ListItem("", "");
var listItem = new List<ListItem>();
listItem.Add(item);
foreach (ShopInfo info in shopLists.Values)
{
item = new ListItem(info.CODE.Trim(), "[" + info.CODE.Trim() + "] " + info.FULLNAME);
listItem.Add(item);
}
comboBox.DisplayMember = "Name";
comboBox.ValueMember = "Code";
comboBox.DataSource = listItem;
if (!string.IsNullOrEmpty(shopCode))
{
comboBox.SelectedValue = shopCode;
}
else
{
comboBox.SelectedIndex = 0;
}
}
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-11-16
猜你喜欢
  • 2021-04-29
  • 2022-12-23
  • 2021-07-12
  • 2021-10-08
  • 2022-02-17
  • 2022-12-23
相关资源
相似解决方案