■ 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 |
using Infragistics.Win.UltraWinGrid; private UltraGrid ultraGrid; ... #region UltraGrid 레이아웃 초기화 하기 - ultraGrid_InitializeLayout(sender, e) /// <summary> /// UltraGrid 레이아웃 초기화 하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void ultraGrid_InitializeLayout(object sender, InitializeLayoutEventArgs e) { e.Layout.MaxRowScrollRegions = 2; e.Layout.AddNewBox.Hidden = false; } #endregion #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) { if(e.Row.Band.Index == 0) { e.Row.ExpandAll(); } } #endregion #region UltraGrid PAINT 처리하기 - ultraGrid_Paint(sender, e) /// <summary> /// UltraGrid PAINT 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void ultraGrid_Paint(object sender, PaintEventArgs e) { if(this.ultraGrid.DisplayLayout.RowScrollRegions.Count == 1) { this.ultraGrid.DisplayLayout.RowScrollRegions[0].Split(); this.ultraGrid.DisplayLayout.RowScrollRegions[0].Height = (int)(this.ultraGrid.Height * 0.6d); } } #endregion |
※ 행 스크롤 영역을 2개 만들어 첫번째 영역에서 액티브 행을 보여주고, 두번째 영역에서 추가 행을 보여준다.