且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

(WPF Datagrid)如何确定项目的列索引

更新时间:2021-09-27 06:41:59

您可以直接使用下面的代码来获取所选单元格的列索引。

You can use below code directly to get selected cells column index.

int index = datagrid.SelectedCells[0].Column.DisplayIndex;