首页 > Windows开发 > 详细

Datagridview 表头常规

时间:2021-03-04 10:20:05      阅读:29      评论:0      收藏:0      [点我收藏+]

this.dataGridView1.ReadOnly = true;
this.dataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
this.dataGridView1.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
this.dataGridView1.ScrollBars = ScrollBars.Vertical;
dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;
dataGridView2.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;

dataGridView1.AllowUserToAddRows = false;
dataGridView1.AutoResizeColumns();
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
dataGridView1.MultiSelect = false;

dataGridView1.Columns.Clear();
dataGridView1.RowHeadersVisible = false;
dataGridView1.Columns.Add("id", "序号");
dataGridView1.Columns.Add("name", "名称");

Datagridview 表头常规

原文:https://www.cnblogs.com/wsyyzy/p/14478167.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!