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;

浙公网安备 33010602011771号