this.dataGridView1[0,1]=????能直接这么写么为什么我写什么类型的值都报错?

解决方案 »

  1.   

    this.dataGridView1.rows(0)("colnumName").tostring=xxxxx
      

  2.   

    不好意思,写得快写错了,是value=xxxxxx
      

  3.   

    这样写:dataGridView1.Rows[0].Cells[0].Value=???.
      

  4.   

    dataGridView1.Rows[0].Cells[1].Value=???.
      

  5.   


    或者dataGridView1.Rows[0][1].Value=???.
      

  6.   

    DataGridView1[0, 0].Value = "";
                DataGridView1.Rows[0].Cells[0].Value=""
      

  7.   

    楼上们的写法根本写不上!索引超出范围。必须为非负值并小于集合大小。
    参数名: index dataGridView1[8,3].Value = "eeeeeee";        private System.Windows.Forms.DataGridViewTextBoxColumn Column8;
      

  8.   

    GridView1.Rows[i].Cells[1].Text = "gogogo";
      

  9.   

    我上面说的是 GridView 已经执行了 DataBind() 之后,更改单元格的值。不知道你是不是要这种,还是要 GridView 无数据,直接给 GridView 填充数据?