Click here to Skip to main content
15,896,359 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
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.
Posted
Updated 28-Mar-11 1:18am
v4
Comments
Sandeep Mewara 28-Mar-11 5:51am    
Not clear. What edited column?
girish sp 28-Mar-11 6:02am    
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.

1 solution

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..
C#
//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     
  }
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900