c# winform获取gridview数据

复制代码
                //取单元格数据三种方法
        this.dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString();//第一种取法
        this.dataGridView1.Rows[e.RowIndex].Cells["你所要取值的列名称"].Value.ToString();//第二种取法
        this.dataGridView1.CurrentRow.Cells["你所要取值的列名称"].Value.ToString();//第三种取法
                注意读取时单元格数据为null
posted @ 2023-11-04 15:58  林新i  阅读(965)  评论(0编辑  收藏  举报