Solved

Selecting with Listview

Posted on 2001-08-06
3
161 Views
Last Modified: 2010-04-06

If I have a listview with 10 rows (items) listed in it, with an image on every row, and 4 columns across, how can I get the item number when the user clicks on any column or image. For example, if listview has columns named
field 1, field 2, field 3, and field 4, and they double click the field 4, the 3rd row from the top, I want to know that item[2] was chosen (starts at 0, so the 3rd row is item[2]).  In other words I'm trying to determine what row the user clicked no matter where he clicks.

         Thanks    
0
Comment
Question by:jexd99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Accepted Solution

by:
Slavak earned 100 total points
ID: 6358545
ListView.Selected.Index will return the row number
0
 

Expert Comment

by:comptebidon81
ID: 6361329
And set RowSelect to True...

GunDamn
0
 

Author Comment

by:jexd99
ID: 6362195
Wow that was easy, I'm embarassed to say how long I spent trying to figure this one out! :-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 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