Datagridview
1、加模板的行号:
dim i as Integer =dgvProduct.Rows.Count
dgvProduct.Rows(i - 1).HeaderCell.Value = i.ToString
2、改变行的颜色:
dgvProduct.Rows(i - 1).DefaultCellStyle.BackColor = Color.Yellow
本文介绍了DataGridView控件中如何为模板行添加行号以及如何更改行的颜色。通过简单的代码示例展示了这两种常见需求的具体实现方法。
Datagridview
1、加模板的行号:
dim i as Integer =dgvProduct.Rows.Count
dgvProduct.Rows(i - 1).HeaderCell.Value = i.ToString
2、改变行的颜色:
dgvProduct.Rows(i - 1).DefaultCellStyle.BackColor = Color.Yellow

被折叠的 条评论
为什么被折叠?