■ 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 |
using System; using Infragistics.Win.UltraWinEditors; using Infragistics.Win.UltraWinGrid; private UltraGrid ultraGrid; private UltraTextEditor ultraTextEditor; ... #region UltraGrid 선택 변경 후 처리하기 - ultraGrid_AfterSelectChange(sender, e) /// <summary> /// UltraGrid 선택 변경 후 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void ultraGrid_AfterSelectChange(object sender, AfterSelectChangeEventArgs e) { if(this.ultraGrid.Selected.Rows.Count > 0) { this.ultraTextEditor.Text = "Band, Row \n"; foreach(UltraGridRow rowSelected in this.ultraGrid.Selected.Rows) { this.ultraTextEditor.Text += rowSelected.Band.Index.ToString() + " , " + rowSelected.Index.ToString() + "\n"; } } } #endregion #region Select Band 0 Row 1 버튼 클릭시 처리하기 - selectBand0Row1Button_Click(sender, e) /// <summary> /// Select Band 0 Row 1 버튼 클릭시 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void selectBand0Row1Button_Click(object sender, System.EventArgs e) { this.ultraGrid.Rows[1].Selected = true; } #endregion #region Clear Selected Rows 버튼 클릭시 처리하기 - clearSelectedRowsButton_Click(sender, e) /// <summary> /// Clear Selected Rows 버튼 클릭시 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void clearSelectedRowsButton_Click(object sender, System.EventArgs e) { this.ultraGrid.Selected.Rows.Clear(); this.ultraTextEditor.Text = "*cleared*"; } #endregion |