当前位置:编程学习 > C#/ASP.NET >>

.net技术点击button更改datagridview字段中的数据!!

.net技术点击button更改datagridview字段中的一个数据!!

.net技术点击button更改datagridview字段中的全部数据!!

双双求解~ ~! --------------------编程问答--------------------

 private void button2_Click(object sender, EventArgs e)
        {
            for(int i=0;i<dataGridView1.Rows.Count;i++)
            {
               dataGridView1.Rows[i].Cells[3].Value=0;
            }
        }
--------------------编程问答-------------------- 1    问题表述不清
2    揭帖率0.00% --------------------编程问答-------------------- 1.dataGridView1[字段名, e.RowIndex].Value=你要改的值;

2. for(int i=0;i<dataGridView1.Rows.Count;i++)
  {
    (dataGridView1[字段名, i].Value=你要改的值;
  }

--------------------编程问答-------------------- 说清楚~~!!
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,