simlox
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...
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...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
ASKER
Thanx... this does exactly what i want... and thanx to the the other experts for taking time out to give me an answer.
Use the Subitems of Listview as:
mySubItemValue = objItem.SubItems(i) ?
regards.