private void checkedListBox_config_Init() { IList <Service.Model.YY_RTU_CONFIGITEM> list = PublicBD.db.GetRTU_ConfigItemList(""); foreach (var item in list) { ComboxItem cbi = new ComboxItem(); cbi.ID = item.ConfigID; cbi.Name = item.ConfigItem; checkedListBox_config.Items.Add(cbi); } checkedListBox_config.DisplayMember = "Name"; checkedListBox_config.ValueMember = "id"; }
private void comboBox_Item_Init() { IList <Service.Model.YY_RTU_ITEM> list = PublicBD.db.GetItemList(""); foreach (var item in list) { ComboxItem cbi = new ComboxItem(); cbi.ID = item.ItemID; cbi.Name = item.ItemName; comboBox_Item.Items.Add(cbi); } comboBox_Item.DisplayMember = "Name"; comboBox_Item.ValueMember = "id"; comboBox_Item.SelectedIndex = 0; }