본문 바로가기

.Net/C#

[DevExpress] 정렬전, 정렬후 GridControl 선택한 Row 인덱스 얻기 ( Get Row Index)

GridControl의 GridView ID =>  gdvSurgeStatus

 

// 고정된 Row의 인덱스를 반환 

int[] p = this.gdvSurgeStatus.GetSelectedRows();

 

//고정된 Row의 인덱스를 정렬전의 초기 인덱스로 변환

int j = this.gdvSurgeStatus.GetDataSourceRowIndex(p[0]);

 

//다른점은 메시지박스를 띄어서 확인

 

참고 : docs.devexpress.com/WindowsForms/DevExpress.XtraGrid.Views.Base.ColumnView.GetDataSourceRowIndex(System.Int32)