반응형
사전 작업 : GridControl -> Run Designer -> View탭 ->이벤트(액션 볼트)에서 해당 이벤트에 이벤트 함수명을 적어줘야함
- 행(Row) 높이 변경
private void gridControl_CalcRowHeight(object sender, RowHeightEventArgs e)
{
e.RowHandle //해당 행
Ex)
e.RowHandle = 15;
}
- Row, Cell 스타일 변경
private void gridControl_RowCellStyle(object sender, RowCellStyleEventArgs e)
{
e.RowHandle //해당 행
Ex)
e.Appearance.BackColor = Color.FromArgb(255, 255, 255);
e.Appearance.BackColor = Color.Black;
}
- Cell 값 변경 또는 Cell 내의 Text값 변경
private void gridControl_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
{
e.Value //해당 셀 값
e.DisplayText //해당 셀의 Text
Ex)
if(e.Value == null)
e.DisplayText = "Hello";
e.DisplayText = e.DisplayText + " World"; // 결과 : Hello World
}
반응형
'C# > DevExpress' 카테고리의 다른 글
GridControl DataTable 행 복사, 행 삭제, GridView포커스 행 삭제 (0) | 2022.11.23 |
---|---|
GridControl GridView 행 추가 (0) | 2022.11.23 |
[C#]공공데이터 XML 데이터를 Dictionary에 담기(공휴일) (0) | 2022.11.22 |