1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| private void button4_Click(object sender, EventArgs e)
{
DateTime dt = DateTime.Now;
dataGridView1.Rows.Add("" + dt.Year.ToString() + "", "En cours", "0");
if (dataGridView1.SelectedRows.Count == 1)
{
DataGridViewRow row = dataGridView1.SelectedRows[0];
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
// int ik = (int)dataGridView1.Rows[i].Cells[3].Value;
foreach (DataGridViewRow row1 in dataGridView1.Rows)
{
foreach (DataGridViewCell cell in row1.Cells)
{
if (cell.Value != null)
{
dataGridView1.Rows[i].Cells[2].Value = 1;
}
else //if (string.IsNullOrEmpty( cell.Value.ToString()))
{
break;
}
}
}
}
}
} |
Partager