■ UltraGrid 클래스에서 행 레이아웃을 설정하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
using Infragistics.Win.UltraWinGrid; private UltraGrid ultraGrid; ... DataTable table = new DataTable("Sample" ); table.Columns.Add("Col1", typeof(string)); table.Columns.Add("Col2", typeof(string)); table.Columns.Add("Col3", typeof(string)); for(int i = 0; i < 100; i++) { table.Rows.Add("가" + i + 1, "나" + i + 2, "다" + i + 3); } this.ultraGrid.DataSource = table; UltraGridBand band = this.ultraGrid.DisplayLayout.Bands["Sample"]; ColumnsCollection gridColumns = band.Columns; band.RowLayoutStyle = RowLayoutStyle.GroupLayout; // OriginX OriginY SpanX SpanY gridColumns["Col1"].RowLayoutColumnInfo.Initialize(0, 0, 1, 1); gridColumns["Col2"].RowLayoutColumnInfo.Initialize(1, 0, 1, 1); gridColumns["Col3"].RowLayoutColumnInfo.Initialize(0, 1, 2, 1); gridColumns["Col3"].CellMultiLine = DefaultableBoolean.True; gridColumns["Col1"].RowLayoutColumnInfo.WeightX = 1.0f; gridColumns["Col3"].RowLayoutColumnInfo.WeightY = 1.0f; this.ultraGrid.DisplayLayout.Override.DefaultRowHeight = 100; this.ultraGrid.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns; band.Override.RowSpacingAfter = 5; |