private void LoadCount() { for (int i = 0; i < Count; i++) { dgv.Rows[i].Cells[1].Value = SAV.GetApricornCount(i).ToString(); } }
private void Setup() { dgv.Rows.Clear(); dgv.Columns.Clear(); DataGridViewColumn dgvApricorn = new DataGridViewTextBoxColumn(); { dgvApricorn.HeaderText = "Slot"; dgvApricorn.DisplayIndex = 0; dgvApricorn.Width = 135; dgvApricorn.ReadOnly = true; dgvApricorn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; } DataGridViewComboBoxColumn dgvCount = new() { DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing, DisplayIndex = 0, Width = 135, FlatStyle = FlatStyle.Flat, ValueType = typeof(int), }; { for (var i = 0; i <= 99; i++) { dgvCount.Items.Add(i); } dgvCount.DisplayIndex = 1; dgvCount.Width = 45; dgvCount.FlatStyle = FlatStyle.Flat; } dgv.Columns.Add(dgvApricorn); dgv.Columns.Add(dgvCount); dgv.Rows.Add(Count); for (int i = 0; i < Count; i++) { dgv.Rows[i].Cells[0].Value = itemlist[i]; dgv.Rows[i].Cells[1].Value = SAV.GetApricornCount(i); } }