Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I have a listview with three columns and i have added 4 records in the listview.
I would like to get the value of the 2nd column value of each records.How to implement it?
Posted 17-Aug-12 7:32am
Comments
Kenneth Haugland at 17-Aug-12 13:43pm
   
WinForm or WPF, It dosent really matter if is binded in code behind though.
Shankar23G at 17-Aug-12 13:46pm
   
I can't understand what you said?
Wes Aday at 17-Aug-12 14:08pm
   
What is it that you have tried?
losmac at 17-Aug-12 18:13pm
   
Start here: <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.aspx">http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.aspx</a> and then see this: <a href="http://forums.codeguru.com/showthread.php?337373-get-value-from-a-listview-column">http://forums.codeguru.com/showthread.php?337373-get-value-from-a-listview-column</a>

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

you can try this code
 
int i=0;
while (i < listView1.SelectedItems.Count)
{
               x = listView1.Items[i].SubItems[1].Text.ToString();
               i++;
}
 
Try and revert back
  Permalink  

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

  Print Answers RSS
0 Dnyaneshwar@Pune 1,300
1 Sergey Alexandrovich Kryukov 667
2 Tadit Dash 350
3 ravikhoda 300
4 Manas Bhardwaj 240
0 Sergey Alexandrovich Kryukov 11,224
1 OriginalGriff 6,897
2 Peter Leow 4,795
3 Abhinav S 3,838
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web03 | 2.8.140421.2 | Last Updated 19 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid