■ 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 |
using Infragistics.Win.UltraWinGrid; #region 찾기 - Find(ultraGrid, source) /// <summary> /// 찾기 /// </summary> /// <param name="ultraGrid">UltraGrid</param> /// <param name="source">소스 문자열</param> public void Find(UltraGrid ultraGrid, string source) { foreach(UltraGridRow ultraGridRow in ultraGrid.Rows) { foreach(UltraGridCell ultraGridCell in ultraGridRow.Cells) { if(ultraGridCell.Text.Contains(source)) { ultraGridCell.Activate(); ultraGrid.PerformAction(UltraGridAction.EnterEditMode); ultraGridCell.SelStart = ultraGridCell.Text.IndexOf(source); ultraGridCell.SelLength = source.Length; ultraGrid.DisplayLayout.RowScrollRegions[0].FirstRow = ultraGridRow; return; } } } } #endregion |