(DevExpress) GridControl - Focused Row
GirdControl 테이블 사용시 특정 row에 대하여
추가 수정 삭제 (후 테이블 갱신) 이벤트 발생 시 Selected Row 가 변하는 현상이 발생한다.
이를 그대로 방치하면 UX 를 떨어트린다.
특정 Row 로 Focus 이동
gridView1.FocusedRowHandle = 5;
UPDATE 후 선택된 Row 의 Focus 유지
- text 이름과 일치하는 column 을 찾아 연결시킨다.
gridView1.FocusedRowHandle = gridView1.LocateByDisplayText(0, gridView1.Columns["columnName"], txtColumnName.Text);
포커스 해제 (FocusInvalidRow)
gridView1.FocusInvalidRow();
찾고싶은 row 데이터 추출
DataRow dr = (gridView1.DataSource as DataView).Table.AsEnumerable().FirstOrDefault(row => row.Field<string>("name") == textBox1.Text.ToString());
Reference
ColumnView.FocusInvalidRow() Method | WinForms Controls | DevExpress Documentation
ColumnView.FocusInvalidRow() Method Allows you to temporarily hide the row focus. Namespace: DevExpress.XtraGrid.Views.Base Assembly: DevExpress.XtraGrid.v23.1.dll NuGet Package: DevExpress.Win.Grid Declaration C# VB.NET public void FocusInvalidRow() Publi
docs.devexpress.com
There might be incorrect information or outdated content.
'.NET > Winforms' 카테고리의 다른 글
| [WINFORMS] ComboBox Control data bind (0) | 2023.10.09 |
|---|---|
| [WINFORMS] create controls (dynamic) (0) | 2023.09.08 |
| [WINFORMS][DevExpress] GridControl - GirdView.ColumnFilterChanged 컬럼 필터 이벤트 (0) | 2023.08.21 |
| [WINFORMS] form 데이터 전송 (0) | 2023.08.18 |
| [WINFORMS] Control.ControlCollection 메소드 (0) | 2023.08.16 |