Winform datagridview 设置标题
1.利用datagridview的HeadText来修改标题
如图:
代码如下:
private void InitDataGridViewHead() { dataGridView1.Columns[0].HeaderText = "姓名"; dataGridView1.Columns[1].HeaderText = "年龄"; dataGridView1.Columns[2].HeaderText = "性别"; dataGridView1.Columns[3].HeaderText = "号码"; }