Deleting ListView items 
Author Message
 Deleting ListView items

I have a ListView control with several items listed. I don't have any
trouble deleting the subitems of a specific item using this call:

 With lstvw

.ListItems(itmX.Index).ListSubItems.Clear

End With

But to delete the parent Item I can't seem to figure it out. There is no:

 With lstvw

.Items(itmX.Index).Clear

End With

How do you delete the parent Item and not just the sub items?

BB



Mon, 02 May 2005 15:59:34 GMT  
 Deleting ListView items

Quote:

> With lstvw

>.ListItems(itmX.Index).ListSubItems.Clear

The ListView keeps it's items within it's ListItems Collection. So to
remove one item you would :
.ListItems.Remove ( index )

Quote:
>But to delete the parent Item I can't seem to figure it out. There is no:

HTH

--
Regards, Frank



Mon, 02 May 2005 16:48:49 GMT  
 Deleting ListView items

Quote:
> I have a ListView control with several items listed. I don't have any
> trouble deleting the subitems of a specific item using this call:
[...]
> But to delete the parent Item I can't seem to figure it out.
There is no:

> With lstvw

> .Items(itmX.Index).Clear

  lstvw.ListItems.Remove itmX.Index

This is fairly easy to work out from the documentation, btw...

hth

Adam
--
Vermouth always makes me brilliant unless it makes me idiotic.
                -- E.F. Benson



Mon, 02 May 2005 16:59:53 GMT  
 Deleting ListView items

[...]

Quote:
> The ListView keeps it's items within it's ListItems Collection. So to
> remove one item you would :
> .ListItems.Remove ( index )

Preferably without the parentheses... (doesn't make any difference in
this case, but good practice nevertheless).

[I'll avoid commenting on the grocer's apostrophese. ;-)]

Adam
--
"You know things are getting sad when the singing
'Billy Bass' on the wall starts to look like a company asset."
               -- Alun Jones referring to PSI.NET, December 2000



Mon, 02 May 2005 17:22:36 GMT  
 Deleting ListView items
On 14 Nov 2002 09:22:36 GMT, "Adam D. Barratt"

Quote:


>[...]
>> The ListView keeps it's items within it's ListItems Collection. So to
>> remove one item you would :
>> .ListItems.Remove ( index )

>Preferably without the parentheses... (doesn't make any difference in
>this case, but good practice nevertheless).

>[I'll avoid commenting on the grocer's apostrophese. ;-)]

Oh well, at least it was readable. It's getting late here. At least 3
beers past happy time.. ;-)

--
Regards, Frank



Mon, 02 May 2005 20:44:32 GMT  
 Deleting ListView items
Adam:

Isn't it interesting that in VB.Net the parentheses are added automatically.

Cheers,
Larry Rebich

More tips link to:
http://www.buygold.net/tips

Please:
No personal e-mail questions :-)



Quote:
> In microsoft.public.vb.general.discussion Frank Adam

> [...]
> > The ListView keeps it's items within it's ListItems Collection. So to
> > remove one item you would :
> > .ListItems.Remove ( index )

> Preferably without the parentheses... (doesn't make any difference in
> this case, but good practice nevertheless).

> [I'll avoid commenting on the grocer's apostrophese. ;-)]

> Adam
> --
> "You know things are getting sad when the singing
> 'Billy Bass' on the wall starts to look like a company asset."
>                -- Alun Jones referring to PSI.NET, December 2000



Mon, 02 May 2005 22:41:15 GMT  
 Deleting ListView items

Quote:
> Adam:

> Isn't it interesting that in VB.Net the parentheses are added automatically.

Primarily because VB.Net uses "C style" routine calls, whereas VB
Classic doesn't.

In many cases, the presence of the parentheses makes no difference to VB
Classic. It makes all the difference in the world when there's more than
one parameter, or the parameter is modified.

Adam
--
"And don't tell me there isn't one bit of difference between null and
space, because that's exactly how much difference there is. :-)"



Mon, 02 May 2005 23:15:47 GMT  
 Deleting ListView items



Quote:
> [I'll avoid commenting on the grocer's apostrophese. ;-)]

"Apostrophese"?

Is that a language...?



Mon, 02 May 2005 23:45:09 GMT  
 Deleting ListView items

Quote:



>> [I'll avoid commenting on the grocer's apostrophese. ;-)]

> "Apostrophese"?

> Is that a language...?

;-P You knew what I meant... (or, at least, I hope you did).

I blame far too much postscript writing for frying my brain earlier.

Adam
--
"A computer lets you make more mistakes faster than any invention in
human history - with the possible exceptions of handguns and tequila."
               -- Mitch Ratliffe



Tue, 03 May 2005 01:20:15 GMT  
 Deleting ListView items
On Thu, 14 Nov 2002 10:45:09 -0500, "Jeff Johnson [MVP: VB]"

Quote:



>> [I'll avoid commenting on the grocer's apostrophese. ;-)]

>"Apostrophese"?

>Is that a language...?

I thought it was for dramatic effect. <g>


Tue, 03 May 2005 02:05:15 GMT  
 Deleting ListView items
On 14 Nov 2002 17:20:15 GMT, "Adam D. Barratt"

Quote:




>>> [I'll avoid commenting on the grocer's apostrophese. ;-)]

>> "Apostrophese"?

>> Is that a language...?

>;-P You knew what I meant... (or, at least, I hope you did).

The greek Goddess of superscript commas ? ;-)
I remember the chapter in Ilias when Apostrophese was unable to fight
off the advances of Dotus resulting in the birth of the God of C
programming, Semicolonus.  But i'm drifting OT now.. :-)

--
Regards, Frank



Tue, 03 May 2005 05:27:44 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Delete Listview Item

2. Deleting ListView items

3. Repost: Deleting last listview item

4. Delete last Listview Item

5. How to iterate through and delete mutiple selected items from a listview

6. ListView.EnsureVisible near deleted item

7. listview delete items?

8. Delete multiple listview items?

9. Quick Redraw a ListView After deleting Item(s)

10. Deleting all items from a listview?

11. Delete item in listview

12. Quick Redraw a ListView After deleting Item(s)

 

 
Powered by phpBB® Forum Software