473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Remove ALL items from ListView?

rdi
Why does the following NOT remove the items from the ListView? I need to
remove all the items and re-build the LV based on new information.

Thanks.

--

RDI

(remove the exclamation from the email address)

If lvwFilter.Items.Count > 0 Then

For k = lvwFilter.Items.Count - 1 To 0

lvwFilter.Items.RemoveAt(k)

Next

End If
--

RDI

(remove the exclamation from the email address)
Nov 20 '05 #1
4 4737
rdi
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1
--

RDI

(remove the exclamation from the email address)

"rdi" <rd**@writeme.com> wrote in message
news:us**************@TK2MSFTNGP11.phx.gbl...
Why does the following NOT remove the items from the ListView? I need to
remove all the items and re-build the LV based on new information.

Thanks.

--

RDI

(remove the exclamation from the email address)

If lvwFilter.Items.Count > 0 Then

For k = lvwFilter.Items.Count - 1 To 0

lvwFilter.Items.RemoveAt(k)

Next

End If
--

RDI

(remove the exclamation from the email address)

Nov 20 '05 #2
rdi
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1
--

RDI

(remove the exclamation from the email address)

"rdi" <rd**@writeme.com> wrote in message
news:us**************@TK2MSFTNGP11.phx.gbl...
Why does the following NOT remove the items from the ListView? I need to
remove all the items and re-build the LV based on new information.

Thanks.

--

RDI

(remove the exclamation from the email address)

If lvwFilter.Items.Count > 0 Then

For k = lvwFilter.Items.Count - 1 To 0

lvwFilter.Items.RemoveAt(k)

Next

End If
--

RDI

(remove the exclamation from the email address)

Nov 20 '05 #3
On 2004-04-10, rdi <rd**@writeme.com> wrote:
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1


Can't you just call lvwFilter.Items.Clear?

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
"There was a point to this story, but it has temporarily
escaped the chronicler's mind."

- This line perhaps best sums up the whole book.
Nov 20 '05 #4
On 2004-04-10, rdi <rd**@writeme.com> wrote:
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1


Can't you just call lvwFilter.Items.Clear?

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
"There was a point to this story, but it has temporarily
escaped the chronicler's mind."

- This line perhaps best sums up the whole book.
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: rdi | last post by:
Why does the following NOT remove the items from the ListView? I need to remove all the items and re-build the LV based on new information. Thanks. -- RDI (remove the exclamation from...
2
by: Mamatha | last post by:
Hi I have an application with listview.When i click on one button the data will be displayed like this in the listview: colA colB colC ----- ----- ------...
7
by: Progalex | last post by:
Hi everybody! I have a listview and a treeview in a form . With an OpenDialog I let the user select multiple files and then these files are added to the listview with the complete pathname,...
6
by: Nick | last post by:
Hi there, I'm trying to implement drag-drop for my listview control in large icon view mode. Unfortunately the order of the items gets completely messed up upon inserting the item back into the...
7
by: Mike Johnson | last post by:
How do I remove a item that's been selected from a listview? I'm using Visual Basic 2005 express edition. Thanks
2
by: Kela | last post by:
An interesting problem: I have a ListView with LabelEdit set to TRUE. When I change the label, I want to make some decisions as to whether the ListViewItem (that's just been edited) should stay in...
1
by: dvestal | last post by:
I have a ListView with checkboxes. I want to remove items when the checkboxes are unchecked, but to do so yields an ArgumentOutOfRangeException. Is there an easy way to get around this? A...
0
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.