本文介绍了在列表视图中获取编辑的列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以在ListViewMouseDoubleClick事件的listview中获取编辑后的列名?

其实我有可以编辑的列表视图.我将编辑特定列并使用ListViewHitTestInfo hit=listView1.HitTest(e.X,e.Y);
更新数据我还想知道该特定列的列标题名称.怎么办?

预先感谢.

Is there any way to get the edited column name in listview in ListViewMouseDoubleClick event??

Actually I have got listview which can be edited. I will edit particular column and update the data using ListViewHitTestInfo hit=listView1.HitTest(e.X,e.Y);
I also want to know the column header name of that particular column. How can it be done?

Thanks in advance.

推荐答案

//tagging the columns
item.SubItems[index].Tag="tag value";

//comparing the tag values with the selected column tag
for ( int a = 0; a<lItem.SubItems.Count;a++)
{
  if (hit.SubItem.Tag == lItem.SubItems[a].Tag)
  {
                                   //your code goes here     
  }
}


这篇关于在列表视图中获取编辑的列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 11:10