473,396 Members | 1,927 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.

ListView search

Hello,

I want to update an item in a listview, to perform this I search the items
collection to

find the item with the corresponding text. Is there a more efficient way to
perform this? In a listview with 2000+ items I experience quite a
bottleneck... thanks.
Nov 20 '05 #1
2 1835
ISK
take a look at this post:
http://www.dotnet247.com/247referenc.../13/68921.aspx

somehow the Contains of the listviewitemscollection does not work the way
you would want it to function (match based on text). as mentioned in the post,
you could use an arraylist (or hashtable) to store the text and index of your list
items and then do a search on the data structure ('binarysearch' method in case
of the arraylist, 'containskey' or 'containsvalue' method in case of hashtable) which
would be much faster. ofcourse, the downside is that you've added a storage
overhead. i'm not sure how bad that would be in your case - but you'll have to
compromise one for the other..

hope this helps..

hope this helps..

"George" wrote:
Hello,

I want to update an item in a listview, to perform this I search the items
collection to

find the item with the corresponding text. Is there a more efficient way to
perform this? In a listview with 2000+ items I experience quite a
bottleneck... thanks.

Nov 20 '05 #2
Thanks for your response ISK, I think that there are many little things
missing from the framework and that's annoying (especially with such a good
overall work). Let's hope that at the future versions most of them will be
history ;-)

Ο "ISK" <IS*@discussions.microsoft.com> έγραψε στο μήνυμα
news:0A**********************************@microsof t.com...
take a look at this post:
http://www.dotnet247.com/247referenc.../13/68921.aspx

somehow the Contains of the listviewitemscollection does not work the way
you would want it to function (match based on text). as mentioned in the post, you could use an arraylist (or hashtable) to store the text and index of your list items and then do a search on the data structure ('binarysearch' method in case of the arraylist, 'containskey' or 'containsvalue' method in case of hashtable) which would be much faster. ofcourse, the downside is that you've added a storage overhead. i'm not sure how bad that would be in your case - but you'll have to compromise one for the other..

hope this helps..

hope this helps..

"George" wrote:
Hello,

I want to update an item in a listview, to perform this I search the items collection to

find the item with the corresponding text. Is there a more efficient way to perform this? In a listview with 2000+ items I experience quite a
bottleneck... thanks.

Nov 20 '05 #3

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

Similar topics

8
by: Jon Ripley | last post by:
Using VB6 (for two weeks!) I could get a ListBox search working perfectly but with a ListView it has completely stumped me. I've not found any previous posts that have helped :( The user...
3
by: MikeY | last post by:
Hopefully someone can help me on this. I am using C#, making Windows forms. I have created a listView with checkbox's. I have enabled the checkboxes under the properties, and all the data,...
4
by: Tee | last post by:
Hi, Need some help with listview, is there a function that can search the listview for a specified string and return true/false ? Thanks, Tee
1
by: Chris | last post by:
Hi all, I posted the following in microsoft.public.dotnet.framework.windowsforms but it seems that group has little traffic. Hi all, I have a listview box which is populated from methods of...
3
by: Michael.Suarez | last post by:
Is it me, or does it seem like they put no effort into creating the listview control in .Net. listview. A few gripes I have with .Net listview that aren't present in vb6: -Inability to set...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
4
by: spowel4 | last post by:
My form has a listview populated with the 50 states. When the user checks the checkbox within the listview for a particular state, I need to retrieve which state was checked (i.e. if AZ is checked...
4
by: Bill-R | last post by:
I'm trying to convert a vb6 program to vb.net (vb2008 express) I have text data in a Listview Control I use a Textbox to enter characters to search the Listview When a Match is found, I use...
0
by: =?Utf-8?B?TWlrZSBDb2xsaW5z?= | last post by:
I have a listview that when I select an item, it populates a details view. I want to show the item that was selected in the listview by changing it to yellow. Trouble is, the selected item does not...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
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
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...
0
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...

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.