dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.Gold;第一次无效

private void dgv_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) 
{}//修改
DataGridViewCellStyle sty=new DataGridViewCellStyle();

dgv.Rows[e.RowIndex].DefaultCellStyle = sty;

posted @ 2019-11-18 14:08  左正  阅读(426)  评论(0编辑  收藏  举报