抄了个,你也来抄抄~~// create array big enough for all the rows and columns in the grid
        string[,] LogArray = new string[dataGridView1.Rows.Count, dataGridView1.Columns.Count];        int i = 0;
        int x = 0;
        foreach (DataGridViewRow row in dataGridView1.Rows)
        {
            while (x < dataGridView1.Columns.Count)
            {
                LogArray[i, x] = row.Cells[x].Value != null ? row.Cells[x].Value.ToString() : string.Empty;
                x++;
            }            x = 0;
            i++; //next row
        }

解决方案 »

  1.   

    for (int i = 1; i < 7; i++)
                {
                    for (int j = 3; j < 9; j++)
                    
                   { 
                        
                      string    k =this. dgv.Rows[i].Cells[j].Value.ToString  () ;                        array[i-1, j-3] = Convert.ToDouble(k);
            
                    }                
                } 
      
    *****************************************************************************
    签名档: http://feiyun0112.cnblogs.com/
      

  2.   

    我个人觉得你把GridView的每行数据当成一个对象来读取比较好
      

  3.   

    // create array big enough for all the rows and columns in the grid
            string[,] LogArray = new string[dataGridView1.Rows.Count, dataGridView1.Columns.Count];
     
            int i = 0;
            int x = 0;
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                while (x < dataGridView1.Columns.Count)
                {
                    LogArray[i, x] = row.Cells[x].Value != null ? row.Cells[x].Value.ToString() : string.Empty;
                    x++;
                }
     
                x = 0;
                i++; //next row
            }\
    在这个基础上怎么求这个数组的每一列的最大值和最小值