如何在DataGridView中使用列索引查找列名? [英] How to find column name with column index in DataGridView?
本文介绍了如何在DataGridView中使用列索引查找列名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在 DataGridView
中找到列名。
我有列索引。
I want to find column name in DataGridView
.
I have column index. How can I find it.
dGVTransGrid.CurrentCell.ColumnIndex
:我想要它的列名。
请帮助。
谢谢。
推荐答案
也许有更好的方法,但是为什么不问DataGridView带有该索引的列是什么呢?
There may be a better way, but why don't you just ask the DataGridView what the column with that index is called?
int columnIndex = dGVTransGrid.CurrentCell.ColumnIndex;
string columnName = dGVTransGrid.Columns[columnIndex].Name;
这篇关于如何在DataGridView中使用列索引查找列名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文