SMALL
private void dbView_CellFormatting(object sender,
DataGridViewCellFormattingEventArgs e) {
{
//특정값을 가진 열을 좀 다르게 보여주고 싶을 때
if (e.ColumnIndex == 1)
{
if (e.Value != null)
{
string text = e.Value.ToString();
if (text.Contains("텍스트"))
{
e.CellStyle.ForeColor = Color.Red;
e.CellStyle.SelectionForeColor = Color.Red;
}
}
}
}
참고링크
LIST
'일반' 카테고리의 다른 글
폼닫을시 설정 저장하고 재실행하면 저장된값 가져오기 (0) | 2022.03.04 |
---|---|
C# 폴더열기 (0) | 2022.03.04 |
C# 데이터그리드뷰 focus 맞추기 (0) | 2022.03.04 |
C# Delegate (0) | 2022.03.04 |
데이터그리드뷰 서스펜드레이아웃, 더블버퍼링 (0) | 2022.03.04 |