Hide rows in listview?

C

Chris

Is it possible to hide specific rows in a listview?
I currently have a listview in details view and the user can select
multiple views which shows the listview items matching the selected
criteria. I currently populate the listview from a List<> each time the view
is changed, but was curious if it would be possible to just hide rows which
do not match the criteria.
Any help would be appreciated.

Chris
 
M

Michael Bray

Is it possible to hide specific rows in a listview?

Unfortunately I think the only thing you can do is remove it. Of course,
you could keep it in a separte List<> so you can put it back - you don't
have to destroy the ListViewItem.

-mdb
 
C

Chris

Michael Bray said:
Unfortunately I think the only thing you can do is remove it. Of course,
you could keep it in a separte List<> so you can put it back - you don't
have to destroy the ListViewItem.

-mdb

That's what I've been doing, but I have a lot of possible search parameters
and removing/repopulating the listview from a List<> for all these has led
to a rather large listviewPopulate() method. I was just curious if there was
any way to reduce it/make it more efficient :).

Chris
 
M

Michael Bray

That's what I've been doing, but I have a lot of possible search
parameters and removing/repopulating the listview from a List<> for
all these has led to a rather large listviewPopulate() method. I was
just curious if there was any way to reduce it/make it more efficient
:).

Well there is one thing you could try... ListView in .NET 2.0 supports an
OwnerDraw. I'm not sure how much trouble that would be. Maybe you could
somehow call the default drawing mechanisms?

-mdb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top