Solved

How do I extract the distinct values from a listview column

Posted on 2010-08-26
2
394 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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