Solved

How do I extract the distinct values from a listview column

Posted on 2010-08-26
2
380 Views
Last Modified: 2012-05-10
Hello,

I have a list view consisting of four columns. One of the these columns can contain duplicate values.  How can I extract the distinct values from that column.  I want to use those values to populate a combo box.  For example if the list view column has the following valued
1
1
2
2
2
3
3
I would want to extract 1, 2 ,3
0
Comment
Question by:chtullu135
2 Comments
 
LVL 17

Accepted Solution

by:
Zhaolai earned 500 total points
ID: 33535888
Try this:

        For Each item As ListViewItem In ListView1.Items

            If ComboBox1.Items.Contains(item.SubItems(0).Text) = False Then

                ComboBox1.Items.Add(item.SubItems(0).Text)

            End If

        Next

Open in new window

0
 

Author Closing Comment

by:chtullu135
ID: 33541888
Thanks
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now