We help IT Professionals succeed at work.

List View selection problem??

simlox
simlox asked
on
Hi I'm creating an active-x control using a list view
that takes a recordset object and populates the listview control with field names as headers and field data as values within the listview. This all works fine but my problem is that I require the value of the cell clicked and the column header. I can retrieve the list item value and index but not the subitem selected within it.. I'm using the following to get the list item..

Dim objItem As ListItem
Set objItem = lstView.SelectedItem

I have multiselect and select full row set to false...
Comment
Watch Question

Ryan ChongSoftware Tead Lead / Business Analyst / System Analyst / Data Engineer
CERTIFIED EXPERT

Commented:
Hi simlox,

Use the Subitems of Listview as:

mySubItemValue = objItem.SubItems(i) ?

regards.
Hi,

As you can see from jgv's link, this is not an easy thing to do with the list view. This is because that is not what the list view was intended for. It is meant to be used where the user will only access the first column, the remaining columns are purely informational. You should consider using a flexgrid type control, like MSFlexGrid, or VSFlexgrid, which will give you the functionality you want. They support selecting of individual cells as well as a broad range of other functions.

Zaphod.

Author

Commented:
Thanx... this does exactly what i want... and thanx to the the other experts for taking time out to give me an answer.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.