在列表视图中获取编辑的列名 [英] getting the edited column name in listview

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

问题描述

有什么方法可以在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.

推荐答案

以任何方式都无法在列表视图中获取列名,这可以使用网格视图来完成.输入时对值进行标记,以便您可以通过比较标记值来进行比较或编辑或进行任何操作.
any ways the column name cant be obtained in list view,which can be done using grid view..but the alternative to do this is to tag the values when entering so that you can compare or edit or whatsoever by comparing the tag values..
//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     
  }
}


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆