pointofsale_application.EditInventory.FillItemColumn C# (CSharp) Method

FillItemColumn() public method

public FillItemColumn ( List Inventory ) : void
Inventory List
return void
        public void FillItemColumn(List<Item> Inventory)
        {

            int count = 0;
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    Button newBtn = new Button();
                    if (Inventory.Count > count)
                    {
                        newBtn.Content = Inventory[count].Name.ToString();
                        newBtn.Name = Inventory[count].Name.ToString().Replace(" ", String.Empty);
                        newBtn.Click += (s, e) => { Btn_Click(newBtn.Name, Inventory); }; ;
                        Grid.SetColumn(newBtn, j);
                        Grid.SetRow(newBtn, i);
                        ItemGrid.Children.Add(newBtn);
                        count++;
                    }
                }
            }
        }