for (int i = 0; i <= t - 1; i++)

{

DataGridViewRow row = dataGridView1.Rows[i];


value custom = row.Value.ToString();// row.Cells[1].Value;
....