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

copy or extract item from listview

a
Hi,

I inherit my class from listview. Is it possible to copy or extract
information (ListViewItem) from the listview providing the index?

Thanks
Jul 21 '07 #1
2 2241
The Items property on the ListView class will return a collection that
you can pass an index to (through the indexer) and will return a
ListViewItem.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"a" <a@no.comwrote in message
news:On**************@TK2MSFTNGP05.phx.gbl...
Hi,

I inherit my class from listview. Is it possible to copy or extract
information (ListViewItem) from the listview providing the index?

Thanks
Jul 21 '07 #2

"a" <a@no.comwrote in message
news:On**************@TK2MSFTNGP05.phx.gbl...
Hi,

I inherit my class from listview. Is it possible to copy or extract
information (ListViewItem) from the listview providing the index?

Thanks

private void listView1_SelectedIndexChanged(object sender, System.EventArgs
e)
{
ListView.SelectedListViewItemCollection contents =
this.listView1.SelectedItems;

if(contents.Count>0)
label1.Text = contents[0].SubItems[1].Text;
else
label1.Text ="error";
}
Jul 24 '07 #3

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

Similar topics

0
by: keith | last post by:
In a ListView control (two columns), I added a few ListView items. ListView listview=new ListView(); listview.Parent=this; listview.View=View.Details; listview.Columns.Add...
3
by: CaffeineRush | last post by:
I have two Listview controls on the stage: lv_Files lv_SelectedFiles I have a function that copies the selected items from lv_Files to lv_SelectedFiles. I am currently using a loop on the...
13
by: Maheshkumar.R | last post by:
hi groups, I have placed an listview control, i want to iterate thru the control and find the clicked event items. listView2.Items.Add(fname.ToString(), i); how i can perform the iteration...
2
by: ltnats | last post by:
Hi guys, I stuffed around with this for a whole day, searching the groups and trying different methods. So when I finally came up with a solution I thought I would share it, as it could save...
2
by: Tim.Geiges | last post by:
This seems like ti should be very simple but I am sort of a newb and this one is killing me I am just trying to copy all the items that are checked in listView2 over to listView1 when a button is...
4
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't...
1
by: Dragan Ristic | last post by:
How to select all ListView items and then copy that to clipboard (VB 7)? Please help.
1
by: apondu | last post by:
Hi, This is Govadhan, i am a begginer for web services using c#.net. I have written a small web service where in i have created a listview item in the web service method and added some data to...
1
by: BeckyBair | last post by:
Currently I have a program form that has 2 listviews on it. It is able to copy one item from one listview to another. Now the users want to be able to copy several at once from one listview and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.