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

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 = "组名称";

原文地址:https://www.cnblogs.com/zhcnblog/p/2573083.html