473,323 Members | 1,574 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,323 software developers and data experts.

Finding an item in ListView

I need to locate an item in ListView, quickly. I have a listview with items,
for each I added a unique "Tag" property. Is there a simple way to rapidly
search through these items to find based on its Tag value?

Tia, Stu
Nov 16 '05 #1
2 6279
You could create a Hashtable to be used in parallel. Some memory redundancy,
but probably OK unless you have thousands of items in the ListView. The tag
value would be the key in the Hashtable.

--
kevin aubuchon
www.aubuchon-design.com
"Coffee guy" <Co*******@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com...
I need to locate an item in ListView, quickly. I have a listview with items, for each I added a unique "Tag" property. Is there a simple way to rapidly search through these items to find based on its Tag value?

Tia, Stu

Nov 16 '05 #2
Ok thanks, I thought ListCtrl used to offer this functionality, but your
suggestion will work just fine.

"Kevin Aubuchon" wrote:
You could create a Hashtable to be used in parallel. Some memory redundancy,
but probably OK unless you have thousands of items in the ListView. The tag
value would be the key in the Hashtable.

--
kevin aubuchon
www.aubuchon-design.com
"Coffee guy" <Co*******@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com...
I need to locate an item in ListView, quickly. I have a listview with

items,
for each I added a unique "Tag" property. Is there a simple way to

rapidly
search through these items to find based on its Tag value?

Tia, Stu


Nov 16 '05 #3

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

Similar topics

1
by: Phil Watkins | last post by:
I am a novice programer in Vb and I am having a major brain ache finding out which item has been selected within a list view and then either deleting that item or editing them. My searching so...
9
by: C# Learner | last post by:
Has anyone else noticed ListView's unbearable flickering? I have a project containing a list-view with the following: - View: Details - Columns: 5 The following code causes the list-view...
1
by: Jim McLeod | last post by:
Dear Group How am I going wrong with this drag and drop procedure.. private void ResourceList_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e System.Windows.Forms.ListView...
12
by: Mike Smith | last post by:
Hey anyone knows how to find an item in a list view based on text ? Cant seem to get the IndexOf method working. would the LVM_FINDITEM method using SendMessage API work in .Net ?
1
by: plmanikandan | last post by:
Hi, I have a listview with items,subitems.I tems and subitems are added as below listView1.View = View.Details; listView1.Columns.Add("Column 1", 100,HorizontalAlignment.Center);...
2
by: padhuwork | last post by:
Hi All, Basically for ListBox and ListView controls, its possible to add checkboxes. Instead of a checkbox is it possible to add radio button? Generally, when a user clicks on a checkbox, usually...
2
by: Morten Snedker | last post by:
When initializing form (form load) I have lstRadiator.Items.FindByValue("5").Selected = True So when the page is shown in the browser, why doesn't it show option value #5 on the list? It just...
0
by: mesut | last post by:
Hi colleagues, I know this group is not related to ASPX directly, but I'm struggling with this already a week and can't get/find any answer from other groups or internet site... I'm using a...
3
by: luiggye | last post by:
Hi I have a LISTVIEW where every item have 6 subitems (columns). lstBrowse.Columns.Add("Col1", 150, HorizontalAlignment.Left) lstBrowse.Columns.Add("Col2", 150, HorizontalAlignment.Left)...
2
by: witpo | last post by:
Hi, I would like to display all listview items in one row with scroll bar below it – instead of multiple rows and scroll bar on the right. Someone told me that I can achieve it using...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.