Home All Groups Group Topic Archive Search About

ListView ListItems - can they be hidden?

Author
22 Nov 2006 10:44 AM
Phill W.
Is it possible, in a VB'2003 ListView control to hide specific
ListViewItems?

I have a ListView that I've loaded with stuff but it would be useful to
be able to view these items as
(a) the complete list,
(b) a subset that matches a given criteria, or
(c) the complementary subset that doesn't match the criteria.

I've gotten as far as changing the text colour of items in each subset,
greying out the "unwanted" ones, but it would better to hide them
altogether.

Is this possible?

TIA,
    Phill  W.

Author
22 Nov 2006 11:29 AM
Ken Tucker [MVP]
Phill,

            You will have to remove the listviewitem from the listview to
hide it

Ken
-------------------------
Show quoteHide quote
"Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-k> wrote in message
news:ek19lu$ogp$1@south.jnrs.ja.net...
> Is it possible, in a VB'2003 ListView control to hide specific
> ListViewItems?
>
> I have a ListView that I've loaded with stuff but it would be useful to be
> able to view these items as
> (a) the complete list,
> (b) a subset that matches a given criteria, or
> (c) the complementary subset that doesn't match the criteria.
>
> I've gotten as far as changing the text colour of items in each subset,
> greying out the "unwanted" ones, but it would better to hide them
> altogether.
>
> Is this possible?
>
> TIA,
>    Phill  W.
Author
22 Nov 2006 3:47 PM
Phill W.
Ken Tucker [MVP] wrote:
> "Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-k> wrote in message
> news:ek19lu$ogp$1@south.jnrs.ja.net...
>> Is it possible, in a VB'2003 ListView control to hide specific
>> ListViewItems?
>>
> You will have to remove the listviewitem from the listview to
> hide it

I was afraid of that.
I don't suppose there's anyway to pre-prepare a list of ListViewItems
and "plug" them in all in one go, is there?
Ah; No, the Items property is read-only, so I guess not.

OK; if I'm going to have to reload the ListView each time I filter it,
is there anyway I can "lock" the Control, to prevent it redrawing itself
while I'm doing so - it should be faster and a lot less "flickery" than
it is now.

TIA,
    Phill  W.