0
다음 코드를 사용하여 DataGridview의 CellEnter 이벤트에서 셀 스타일을 변경합니다. 하지만 if 문을 제거하면 데이터 바인딩 후 모든 행이 굵게 표시됩니다. 어떤 조언이나 조언?RowIndex 0에서 DataGridviewCellStyle 변경
DataGridViewCellStyle oStyle = new DataGridViewCellStyle();
oStyle.Font = new Font("Microsoft Sans Serif", 9.25f, FontStyle.Bold);
if (e.RowIndex > 0)
{
dataGridView1.Rows[e.RowIndex].Cells[0].Style = oStyle;
dataGridView1.Rows[e.RowIndex].Cells[1].Style = oStyle;
dataGridView1.Rows[e.RowIndex].Cells[2].Style = oStyle;
dataGridView1.Rows[e.RowIndex].Cells[3].Style = oStyle;
dataGridView1.Rows[e.RowIndex].Cells[4].Style = oStyle;
dataGridView1.Rows[e.RowIndex].Cells[5].Style = oStyle;
dataGridView1.Rows[e.RowIndex].Cells[6].Style = oStyle;
dataGridView1.Rows[e.RowIndex].Cells[7].Style = oStyle;
dataGridView1.Rows[e.RowIndex].Cells[8].Style = oStyle;
}