반응형
인프라지스틱스 그리드 컬럼 세팅
public static class GridExt { //컬럼 초기 컬럼 세팅 public static void xAddColumn(this Infragistics.Win.UltraWinGrid.UltraGrid grd, string colName, string displayName, int width= 0, HAlign hAlign = HAlign.Center , VAlign vAlign = VAlign.Middle, bool hidden = false, Activation act = Activation.NoEdit ) { grd.DisplayLayout.Bands[0].Columns.Add(colName, displayName); grd.DisplayLayout.Bands[0].Columns[colName].Width = width; grd.DisplayLayout.Bands[0].Columns[colName].Hidden = hidden; grd.DisplayLayout.Bands[0].Columns[colName].Header.Appearance.TextHAlign = HAlign.Center; grd.DisplayLayout.Bands[0].Columns[colName].Header.Appearance.TextVAlign = VAlign.Middle; grd.DisplayLayout.Bands[0].Columns[colName].CellAppearance.TextHAlign = hAlign; grd.DisplayLayout.Bands[0].Columns[colName].CellAppearance.TextVAlign = vAlign; } //삭제 컬럼정의 //그리드에 노출할 컬럼, 감출 컬럼을 datatable에 정의를 한다음에 그 정보 값으로 그리드에서 보여줄지 안보여줄지를 결정. public static void xHiddenColumn(this Infragistics.Win.UltraWinGrid.UltraGrid grd, DataTable dthiddenColumn) { foreach (DataRow dr in dthiddenColumn.Rows) grd.DisplayLayout.Bands[0].Columns[dr["ColumnNm"].ToString()].Hidden = dr["UseYN"].ToString().Equals("Y") ? false : true; } public static void xSummarySetting(this Infragistics.Win.UltraWinGrid.UltraGrid grd) { //Summary grd.DisplayLayout.Override.SummaryDisplayArea = SummaryDisplayAreas.Default; grd.DisplayLayout.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False; grd.DisplayLayout.Override.SummaryValueAppearance.FontData.Bold = DefaultableBoolean.True; grd.DisplayLayout.Override.SummaryFooterAppearance.BackColor = System.Drawing.SystemColors.GradientActiveCaption; grd.DisplayLayout.Bands[0].Summaries.Add(SummaryType.Formula, null, SummaryPosition.Center); grd.DisplayLayout.Bands[0].Summaries[0].Appearance.BackColor = System.Drawing.SystemColors.GradientActiveCaption; grd.DisplayLayout.Bands[0].Summaries[0].DisplayFormat = "{0}"; grd.DisplayLayout.Bands[0].Summaries[0].SummaryDisplayArea = SummaryDisplayAreas.TopFixed | SummaryDisplayAreas.RootRowsFootersOnly; grd.DisplayLayout.Bands[0].Summaries[0].Appearance.TextHAlign = HAlign.Center; } public static void xSummaryText(this Infragistics.Win.UltraWinGrid.UltraGrid grd, string text= "") { grd.DisplayLayout.Bands[0].Summaries[0].Formula = text; //http://stackoverflow.com/questions/24802947/how-to-force-ultragrid-column-formula-refresh } }
반응형
'Winform' 카테고리의 다른 글
Infragistics.Win.UltraWinEditors.UltraTextEditor (0) | 2015.11.24 |
---|---|
Infragistics.Win.UltraWinEditors.UltraComboEditor (0) | 2015.11.23 |
infragistics grid 선택된 row 삭제 (0) | 2015.09.04 |
infragistics grid 현재 선택 row의 값 가져오기 (0) | 2015.09.04 |
infragistic grid 멀티로 row select (0) | 2015.09.04 |
댓글