在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
如果没有绑定数据库,那么当dataGridView中的数据有所改变或显示的时候可以添加以下的代码:{ if (this.dataGridView1.Rows.Count != 0) { for (int i = 0; i < this.dataGridView1.Rows.Count; ) { this.dataGridView1.Rows[i].DefaultCellStyle.BackColor = System.Drawing.Color.Pink; i += 2; } } }
if (this.dataGridView1.Rows.Count != 0)
{ for (int i = 0; i < this.dataGridView1.Rows.Count; ) { this.dataGridView1.Rows[i].DefaultCellStyle.BackColor = System.Drawing.Color.Pink; i += 2; } } |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论