■ 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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
using System; using System.Drawing; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; private UltraGrid ultraGrid; ... #region UltraGrid 행 초기화 하기 - ultraGrid_InitializeRow(sender, e) /// <summary> /// UltraGrid 행 초기화 하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void ultraGrid_InitializeRow(object sender, InitializeRowEventArgs e) { e.Row.ExpandAll(); } #endregion #region Allow Column Sizing 버튼 클릭시 처리하기 - allowColumnSizingButton_Click(sender, e) /// <summary> /// Allow Column Sizing 버튼 클릭시 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void allowColumnSizingButton_Click(object sender, EventArgs e) { this.ultraGrid.DisplayLayout.Override.AllowColSizing = AllowColSizing.Free; } #endregion #region Header Visible 버튼 클릭시 처리하기 - headerVisibleButton_Click(sender, e) /// <summary> /// Header Visible 버튼 클릭시 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void headerVisibleButton_Click(object sender, EventArgs e) { this.ultraGrid.DisplayLayout.Bands[0].HeaderVisible = true; this.ultraGrid.DisplayLayout.Bands[1].HeaderVisible = true; this.ultraGrid.DisplayLayout.Bands[1].Header.Caption = "Orders"; } #endregion #region Row Connector Style 버튼 클릭시 처리하기 - rowConnectorStyleButton_Click(sender, e) /// <summary> /// Row Connector Style 버튼 클릭시 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void rowConnectorStyleButton_Click(object sender, EventArgs e) { this.ultraGrid.DisplayLayout.Bands[0].Indentation = 0; this.ultraGrid.DisplayLayout.Bands[1].Indentation = 0; this.ultraGrid.DisplayLayout.RowConnectorStyle = RowConnectorStyle.None; } #endregion #region Header Appearance 버튼 클릭시 처리하기 - headerAppearanceButton_Click(sender, e) /// <summary> /// Header Appearance 버튼 클릭시 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void headerAppearanceButton_Click(object sender, EventArgs e) { this.ultraGrid.DisplayLayout.Bands[0].Header.Appearance.ThemedElementAlpha = Alpha.Transparent; this.ultraGrid.DisplayLayout.Bands[0].Header.Appearance.BackColor = SystemColors.ActiveCaption; this.ultraGrid.DisplayLayout.Bands[0].Header.Appearance.ForeColor = SystemColors.ActiveCaptionText; this.ultraGrid.DisplayLayout.Bands[1].Header.Appearance.ThemedElementAlpha = Alpha.Transparent; this.ultraGrid.DisplayLayout.Bands[1].Header.Appearance.BackColor = Color.Blue; this.ultraGrid.DisplayLayout.Bands[1].Header.Appearance.BackColor2 = Color.Red; this.ultraGrid.DisplayLayout.Bands[1].Header.Appearance.ForeColor = Color.White; this.ultraGrid.DisplayLayout.Bands[1].Header.Appearance.BackGradientStyle = GradientStyle.Horizontal; } #endregion |