■ 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 95 96 97 98 99 100 101 102 |
using System; using System.Collections.Generic; using System.Drawing; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; private UltraGrid ultraGrid; ... #region 폼 로드시 처리하기 - Form_Load(sender, e) /// <summary> /// 폼 로드시 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void Form_Load(object sender, EventArgs e) { this.ultraGrid.DataSource = new TestDataProvider(); } #endregion #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.Bands[0].Columns[0].AutoCompleteMode = Infragistics.Win.AutoCompleteMode.Suggest; e.Layout.Bands[0].Columns[0].AutoSuggestFilterMode = AutoSuggestFilterMode.Contains; ValueList valueList = e.Layout.ValueLists.Add("valueList"); valueList.ValueListItems.Add(1, "One" ); valueList.ValueListItems.Add(2, "Two" ); valueList.ValueListItems.Add(3, "Three"); valueList.AutoSuggestHighlightAppearance.ForeColor = Color.Blue; valueList.AutoSuggestHighlightSelectedAppearance.BackColor = Color.Yellow; e.Layout.Bands[0].Columns["Label"].ValueList = valueList; } #endregion /// <summary> /// 테스트 데이터 제공자 /// </summary> public class TestDataProvider : List<TestData> { //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////////////////////////////////////////////// Public #region 생성자 - TestDataProvider() /// <summary> /// 생성자 /// </summary> public TestDataProvider() { Add(new TestData { Label = "One" , Value = 1 }); Add(new TestData { Label = "Two" , Value = 2 }); Add(new TestData { Label = "Three", Value = 3 }); } #endregion } /// <summary> /// 테스트 데이터 /// </summary> public class TestData { //////////////////////////////////////////////////////////////////////////////////////////////////// Property ////////////////////////////////////////////////////////////////////////////////////////// Public #region 라벨 - Label /// <summary> /// 라벨 /// </summary> public string Label { get; set; } #endregion #region 값 - Value /// <summary> /// 값 /// </summary> public int Value { get; set; } #endregion } |