private void btn_Generate_Click(object sender, EventArgs e) { for (int i = 0; i < dataGridView1.Rows.Count-1; i++) { string values = dataGridView1.Rows[i].Cells[4].Value.ToString(); MessageBox.Show(values); } }