Exemplo n.º 1
0
 private void dataGridViewLab06_Reindexate()
 {
     for (int i = 0; i < dataGridViewLab06.RowCount; i++)
     {
         dataGridViewLab06.Rows[i].Cells[0].Value = (i + 1).ToString();
         dataGridViewLab06.Rows[i].Cells[2].Value =
             LabMethods.DigitsCount(
                 Convert.ToInt32(dataGridViewLab06.Rows[i].Cells[1].Value)
                 ).ToString();
     }
 }
Exemplo n.º 2
0
        //
        // Lab06
        //

        private void buttonLab06FillArray_Click(object sender, EventArgs e)
        {
            int rowsCount = Convert.ToInt32(numericUpDownLab06RowsAuto.Value);

            int[] array = LabMethods.GetIntArray(rowsCount, 0, 100000);
            dataGridViewLab06.RowCount = array.Length;
            for (int i = 0; i < array.Length; i++)
            {
                dataGridViewLab06.Rows[i].Cells[0].Value = (i + 1).ToString();
                dataGridViewLab06.Rows[i].Cells[1].Value = array[i].ToString();
                dataGridViewLab06.Rows[i].Cells[2].Value = LabMethods.DigitsCount(array[i]).ToString();
            }
            dataGridViewLab06.ClearSelection();
        }