■ 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 |
using System.Data; using System.Globalization; 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) { DataTable table = new DataTable("DataTable1"); CultureInfo cultureInfo = new CultureInfo("en-US", false); table.Locale = cultureInfo; DataColumn column = new DataColumn("Temperature", typeof(int)); table.Columns.Add(column); for(int i = -5; i <= 10; i++) { table.Rows.Add(i); } this.ultraGrid.DataSource = table; } #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) { OperatorCondition condition1 = new OperatorCondition(ConditionOperator.LessThan , 0); OperatorCondition condition2 = new OperatorCondition(ConditionOperator.GreaterThan, 5); Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance(); appearance1.ForeColor = Color.Red; Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance(); appearance2.ForeColor = Color.Blue; ConditionValueAppearance conditionValueAppearance = new ConditionValueAppearance(); conditionValueAppearance.Add(condition1, appearance1); conditionValueAppearance.Add(condition2, appearance2); this.ultraGrid.DisplayLayout.Bands[0].Columns[0].ValueBasedAppearance = conditionValueAppearance; } #endregion |