datagridview 中要让某一行变色

2024-11-02 03:12:08
推荐回答(2个)
回答1:

dataGridView.Rows[i].DefaultCellStyle.BackColor = Color.Red;

回答2:

If DataGridView1.CurrentRow.Cells("type_id
").Value.ToString = "1" Then
DataGridView1.DefaultCellStyle.BackColor = Color.Red
End If