특정 열에 4의 값을 가진 행의 색상에 대해 빨간색을 넣으려고하고 있지만 행이있는 경우에도 모든 행에 흰 색이 표시됩니다. 4보다 큰 값. 또한 코드를 통해 단계를 밟아 코드가 실제로 백 코드를 변경하는 코드를 실행한다는 것을 알았습니다.DataGridView의 행이 색상을 변경하지 않습니다.
내가 여기서 잘못하고있다.
dataGridViewMain.DataSource = table;
dataGridViewMain.Sort(dataGridViewMain.Columns["Days in the shop"], ListSortDirection.Descending);
foreach (DataGridViewRow row in this.dataGridViewMain.Rows)
{
if (Convert.ToInt32(row.Cells["Days in the shop"].Value) > 4)
row.DefaultCellStyle.BackColor = Color.Red;
}