values.Add(Convert.ToDouble(dataGridView.Rows[j].Cells[i].Value)); 这段代码只能对输入数值类型的值进行操作,如果dataGridView输入字符类型的,就报错!