Link to home
Start Free TrialLog in
Avatar of simlox
simloxFlag for United Kingdom of Great Britain and Northern Ireland

asked on

List View selection problem??

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...
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Hi simlox,

Use the Subitems of Listview as:

mySubItemValue = objItem.SubItems(i) ?

regards.
ASKER CERTIFIED SOLUTION
Avatar of jgv
jgv

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Z_Beeblebrox
Z_Beeblebrox

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.
Avatar of simlox

ASKER

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