How to get the dynamically column index while clicking on a cell using wpf GridControl DevExpress?

StackOverflow https://stackoverflow.com/questions/17839608

  •  04-06-2022
  •  | 
  •  

문제

I have a problem related with the DevExpress GridControl when I click on any GridControl cell then it will return the clicked column Index?

도움이 되었습니까?

해결책

You can identify clicked column and this column visible index using the hit-information returned by the GridView.CalcHitInfo() method:

GridHitInfo hitInfo = gridView1.CalcHitInfo(new Point(e.X, e.Y));
if(hitInfo.InRowCell){
    int columnIndex = hitInfo.Column.VisibleIndex;
    //...
}

Related help-article: Hit Information Overview
Related How-To: Identify the Grid's Element Located Under the Mouse Cursor

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top