ArrayList s = new ArrayList();
for (int i = 0; i < dataGridView1.Rows.Count; i++)//循环dataGridView1的行
{
s.Add(dataGridView1.Rows[i].Cells[0].Value.ToString());//将dataGridView1中的第一列存入s中
}
string []dates = new string[dataGridView1.ColumnCount];
int row = 列数;
for (int i = 0; i < dataGridView1.ColumnCount; i++)
{
dates[i] = dataGridView1[i, row].Value == null ? "" : dataGridView1[i, row].Value.ToStrin();
}