본문 바로가기
카테고리 없음

[C#] DataGridView 홀수/짝수열 배경색 다르게 지정

by IT HUB 2022. 9. 30.
728x90
반응형
            for (int i = 1; i < this.Rows.Count; i++)
            {
                if (i % 2 != 0)
                {
                    this.Rows[i].DefaultCellStyle.BackColor = Color.FromArgb(240255240);
                }
                else
                {
                    this.Rows[i].DefaultCellStyle.BackColor = Color.White;
                }
            }
반응형

댓글