473,657 Members | 2,507 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2257
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.co m

"a" <a@no.comwrot e in message
news:On******** ******@TK2MSFTN GP05.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.comwrot e in message
news:On******** ******@TK2MSFTN GP05.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_Selec tedIndexChanged (object sender, System.EventArg s
e)
{
ListView.Select edListViewItemC ollection contents =
this.listView1. SelectedItems;

if(contents.Cou nt>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
2222
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 ("Col1",200,HorizontalAlignment.Left); listview.Columns.Add ("Col2",800,HorizontalAlignment.Left);
3
17324
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 selected indices to copy. This is quite a slow process when there are a lot of entries selected in lv_Files. There is also a Copy All button that first selects all indices, then loops
13
3757
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 to find the item clicked...? and its item. thankz-- Mähésh Kumär. R
2
4629
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 someone all the stuffing round I had to do. Now I don't know if this will solve everyone's listview copy situation, but it worked for me. Here is the code: ListViewItems LVIARRY_CopiedListViewItems = new
2
2487
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 clicked. can anyone give me an example please? Thank you for your time, Tim
4
10803
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 not want to display this menu if a node selected on the listview but user right click over the empty space of the panel that contain the listview. The problem here is when I use the Listview's Click Event, I don't have ways to verify if the...
1
3610
by: Dragan Ristic | last post by:
How to select all ListView items and then copy that to clipboard (VB 7)? Please help.
1
1908
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 the listview item. Now i have problem. I want this listview to be passed as a return value to the calling program. can some one help me with how to achieve this.
1
5419
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 paste into the other at point/row where they click/selected. I hope that makes sense. Here is what I have currently for the single copy/paste type of process: Private Sub cmdSetSeqNum_Click() Dim ItmX As ListItem On Error GoTo ERR_HNDL...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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
8605
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...
0
5632
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
4302
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
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.