DevExpress / Grid Control - Editable 8월 15, 2024 gridView1 -> OptionsBehavior -> Editable : False or True 자세한 내용 보기
DevExpress / Grid Control - Row Separator 8월 15, 2024 Row Separator with every row gridView1 -> Appearance -> RowSeparator -> BackColor gridView1 -> RowSeparatorHeight : 2 (example) Row Separator with every 10th row 1. gridView1 -> OptionsView -> ShowPreview : True 2. code private void gridView1_CustomDrawRowPreview(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { int rowNumber = e.RowHandle + 1; if(rowNumber % 10 == 0) { e.Cache.FillRectangle(e.Cache.GetSolidBrush(Color.Black), e.Bounds); e.Handled = true; } } private void gridView1_MeasurePreviewHeight(object sender, RowHeightEventArgs e) { int rowNumber = e.RowHandle + 1; if(rowNumber % 10 == 0) { e.RowHeight = 2; } else { e.RowHeight = 0; } } 자세한 내용 보기
DevExpress / Grid Control - Horizontal and Vertical Line 8월 15, 2024 gridView1 -> Appearance -> HorzZLine -> BackColor gridView1 -> Apprearance -> VertLine -> BackColor gridView1 -> OptionsView -> ShowHorizontalLines -> true gridView1 -> OptionsView -> ShowVerticalLines -> true 자세한 내용 보기
DevExpress / Grid Control - Change Cell Color 8월 15, 2024 private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView view = sender as GridView; // 특정 컬럼의 셀 스타일을 변경하고 싶을 때 if (e.Column.FieldName == "YourColumnName") { var cellValue = view.GetRowCellValue(e.RowHandle, e.Column).ToString(); // 특정 조건에 따라 스타일을 변경합니다. if (cellValue == "특정값") { e.Appearance.BackColor = Color.Yellow; // 배경색 e.Appearance.ForeColor = Color.Red; // 글자색 } else if (cellValue == "다른값") { e.Appearance.BackColor = Color.Green; e.Appearance.ForeColor = Color.White; } // 특정 행 번호와 컬럼 이름을 기반으로 셀을 식별합니다. if (e.RowHandle == 2 && e.Column.FieldName == "YourColumnName") { // 조건이 충족되면 색상을 변경합니다. e.Appearance.BackColor = Color.Yellow; // 배경색 e.Appearance.ForeColor = Color.Red; // 글자색 } // 필요에 따라 다른 조건을 추가합니다. } } <example code> private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridVi... 자세한 내용 보기
DevExpress / Grid Control - Set Value to Cell 8월 15, 2024 private void SetValueToGrid(GridControl gc, int nRow, int nCol, string value) { GridView view = gc.MainView as GridView; view.SetRowCellValue(nRow, view.Columns[nCol].FieldName, value); } 자세한 내용 보기
DevExpress / Grid Control - Column Width, Column Header Height, Row Height 8월 15, 2024 Auto Size - Column Width gridView1 -> OptionsView -> ColumnAutoWidth Auto Size - Column Header Height gridView1 -> OptionsView -> columnHeaderAutoHeight Row Height gridView1 -> RowHeight : 40 (example) Column Header Height gridView1 -> ColumnPanelRowHeight : 40 (example) 자세한 내용 보기