Esempio n. 1
0
        private void Demo()
        {
            int    i     = 0;
            Random Randy = new Random();

            while (i < 50)
            {
                int col = Randy.Next(26);
                int row = Randy.Next(50);
                SS.getCell(col, row).getText = "Hello World!";
                //dataGridView1.Rows[row].Cells[col].Value = "Hello World!";
                i++;
            }

            int B = 0;

            while (B < 50)
            {
                //SS.getCell(1, B)._Text = "This is Cell B" + (B + 1).ToString();
                dataGridView1.Rows[B].Cells[1].Value = "This is Cell B" + (B + 1).ToString();
                B++;
            }
            int j = 0;

            while (j < 50)
            {
                //SS.getCell(0, j)._Text = "=B" + (j + 1).ToString();
                //dataGridView1.Rows[j].Cells[0].Value = SS.getCell(0, j)._Value;
                j++;
            }
        }
Esempio n. 2
0
 private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null)
     {
         if (CxR.getCell(e.ColumnIndex, e.RowIndex)._Text == dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString())
         {
             dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = CxR.getCell(e.ColumnIndex, e.RowIndex)._Value;
         }
         else
         {
             CxR.getCell(e.ColumnIndex, e.RowIndex)._Text = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
         }
     }
     else
     {
         CxR.getCell(e.ColumnIndex, e.RowIndex)._Text = "";
     }
 }