473,656 Members | 2,793 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4761
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.c om> wrote in message
news:us******** ******@TK2MSFTN GP11.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.c om> wrote in message
news:us******** ******@TK2MSFTN GP11.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.c om> 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.c om> 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
212
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 the email address)
2
6296
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 ----- ----- ------ nannacom.com 0 0 When i click on another button,i want to display like this
7
10409
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, while they are added to the treeview without the path (only file name). I'd like the user would be able to remove multiple items selecting filenames from the listview. So, items should be removed both from the listview and the treeview. How can I do...
6
3400
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 listview, removing the item obviously keeps everything fine but the second I use insert the item is added to the *end* of the listview. Does anyone have any tips on how I can solve this issue?? Call Items.Remove(SourceItem)
7
2027
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
3936
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 the ListView or not. The natural place to inspect this is in the AfterLabelEdit event... If the decision is to take the item out, I used the ListViewItem.Remove(). However - check this out: A) say that the item's index is N (indices are...
1
5079
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 simple program that illustrates the exception is below: using System; using System.Windows.Forms; namespace WindowsApplication1
0
1886
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 form every thing works fine: checking items by code as well as checking with mouse: Using the CheckdItems Property is confused too.
2
6823
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 form every thing works fine: checking items by code
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8498
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8600
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.