简体   繁体   English

如何在DevExpress Gridview中获取单元格索引?

[英]How to get cell index in DevExpress Gridview?

I have 6 columns on gridview (shown as figure). 我在gridview上有6列(如图所示)。 How to get cell index? 如何获得细胞指数? For example, when I handle double click Durum(Status) column or Detay(Detail) column on gridview, return index numbers. 例如,当我双击gridview上的Detay(Detail) Durum(Status)列或Detay(Detail)列时,返回索引号。 Actually I want to do that when I double click different cell of the row, happen different things. 实际上,当我双击该行的不同单元格时,我想这样做。 For example I double click the status cell of the row, change the status or I double click the detail cell of the same row, open new form. 例如,我双击该行的状态单元格,更改状态,或者双击同一行的详细信息单元格,打开新表单。 How can I do this? 我怎样才能做到这一点?

数字

Try this: 尝试这个:

private void gridView1_DoubleClick(object sender, EventArgs e) {
   var gv = sender as GridView;
   var rowIndex = gv.FocusedRowHandle;
   var columnIndex = gv.FocusedColumn.VisibleIndex;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM