Example #1
0
        private void LoadSubItems(ComboBox comboBox)
        {
            var subItemList = new SubItemDAL().GetAllSubItemsForLookUp();

            subItemList.ForEach(delegate(SubItemLookUp obj)
            {
                obj.SubItemDescription = obj.SubItemSerial + " - " + obj.SubItemDescription;

            });

            var subItem = new SubItemLookUp();
            subItem.SubItemDescription = "Select PLU";
            subItem.SubItemID = -1;

            subItemList.Add(subItem);

            comboBox.DataSource = subItemList;
            comboBox.ValueMember = "SubItemID";
            comboBox.DisplayMember = "SubItemDescription";

            comboBox.SelectedValue = -1;
        }