Solved

Get ListView subitem row and column when clicked

Posted on 2010-11-10
2
676 Views
Last Modified: 2012-05-10
Hi Experts,

I am using a Listview control with multiple rows (items) and columns (subitems). I would like to get the row and column of the subitem I have clicked on.
0
Comment
Question by:DColin
2 Comments
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 34101445
Hi,

First clear the rowselection mode to cell.
Second on selectedrow and column you can get the value of that cell.  
0
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
ID: 34101638
Use the MouseClick event, and get the item clicked with a ListView HitTest....

    Private Sub ListView1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseClick
        Dim ht As ListViewHitTestInfo = ListView1.HitTest(e.Location)
        If ht.Location = ListViewHitTestLocations.Label Then
            MsgBox(ht.SubItem.Text)
        End If
    End Sub

Wayne
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

14 Experts available now in Live!

Get 1:1 Help Now