■ UltraGrid 클래스의 BeforeEnterEditMode 이벤트를 사용하는 방법을 보여준다.
▶ 예제 코드 (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 |
using System.ComponentModel; using Infragistics.Win.UltraWinGrid; private UltraGrid ultraGrid; ... #region UltraGrid 편집 모드 진입 전 처리하기 - ultraGrid_BeforeEnterEditMode(sender, e) /// <summary> /// UltraGrid 편집 모드 진입 전 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void ultraGrid_BeforeEnterEditMode(object sender, CancelEventArgs e) { if(this.ultraGrid.ActiveCell == null) { return; } if(this.ultraGrid.ActiveCell.Column.Key != "Bonus") { return; } Employee employee = this.ultraGrid.ActiveCell.Row.ListObject as Employee; if(BusinessLogicManager.EmpDeservesBonus(employee) == false) { e.Cancel = true; } } #endregion |