Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

listview how to hide a row 2

Status
Not open for further replies.

testeng

Technical User
Apr 5, 2001
32
US
Is there a way to hide a row in a listview? As the listview is being populated with rows of data some of them I want to keep hidden from the end user but still in the listview to use later in the program. I could store that data in an array but now I am more curious of how to hide a row in a listview
 
You cannot hide listview items using the standard API for the simple reason that it would be a nighmare to manage internally. You could have a custom draw to enable you to do this but managing it is difficult.

Routines which tell you which item is at a certain point may or may not work since the simple way is y coordinate divided by height of list item. But if you have missing items, that doesn't work so it becomes a sequential search which is a bad excuse for a fast machine.

Switching between detailed view and iconified view may be a problem too for the same reason. Which item is at position x, y? A simple calculation will work it out but not if there are items missing.
 
>it would be a nighmare to manage internally

Whilst it is true that there is no API call or object method that allows this, I'm not sure that it would be a nightmare to manage (if such a call existed). Surely all Microsoft needed to have built in would be a Visible property for a ListItem to accompany the already existing Gghosted property? They'd do all the nasty management for you.

But yes, the only way (that I am aware of) to achieve it is to create an ownerdraw ListView, and that only works in Report View ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top