获取选中行,行的值,修改列头名称

string grpName = this.dgvGroup.SelectedCells[0].Value.ToString(); //主要用于一整行

获取选中行中的的值,其中cells[0]控制哪一列

this.txtGrpName.Text = this.dgvGroup.Rows[this.dgvGroup.CurrentCell.RowIndex].Cells[0].Value.ToString();

修改dgv的列名

dgvGroup.Columns[0].HeaderText = "组名称";

posted @ 2012-07-02 14:06  zhcnblog  阅读(195)  评论(0编辑  收藏  举报