728x90
반응형
728x170
using System.Drawing;
using System.Windows.Forms;
private DataGridView dataGridView;
...
#region DataGridView 셀 포맷하기 - dataGridView_CellFormatting(sender, e)
/// <summary>
/// DataGridView 셀 포맷하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void dataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if(e.ColumnIndex == 1)
{
if(e.Value != null)
{
string text = e.Value.ToString();
if(text.Contains("Bike"))
{
e.CellStyle.ForeColor = Color.Red;
e.CellStyle.SelectionForeColor = Color.Red;
}
}
}
}
#endregion
728x90
반응형
그리드형(광고전용)
'C# > WinForm' 카테고리의 다른 글
[C#/WINFORM] 비트맵 명도 조정하기 (0) | 2015.06.13 |
---|---|
[C#/WINFORM] 회색조 비트맵 구하기 (0) | 2015.06.13 |
[C#/WINFORM] RichTextBox 클래스 : 텍스트 라인 추가하기 (0) | 2015.05.15 |
[C#/WINFORM] RichTextBox 클래스 : 텍스트 추가하기 (0) | 2015.05.15 |
[C#/WINFORM] 컨트롤 포커스 이동하기 (0) | 2015.04.28 |
[C#/WINFORM] DataGridView 클래스 : CurrentCell 속성을 사용해 현재 셀 NULL 설정하기 (0) | 2015.04.26 |
[C#/WINFORM] DataGridView 클래스 : 특정 열 또는 행 고정하기 (0) | 2015.04.26 |
[C#/WINFORM] DataGridView 클래스 : RowPostPaint 이벤트를 사용해 행 번호 표시하기 (0) | 2015.04.26 |
[C#/WINFORM] DataGridView 클래스 : SelectionMode 속성을 사용해 행 단위 선택 설정하기 (0) | 2015.04.26 |
[C#/WINFORM] DataGridView 클래스 : MultiSelect 속성을 사용해 단일 선택 설정하기 (0) | 2015.04.26 |
댓글을 달아 주세요