I am very new to listview, hope to get reply soon. Thank you in advance.
16 Replies - 785 Views - Last Post: 29 December 2012 - 04:05 AM
#1
I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 02:16 AM
I am very new to listview, hope to get reply soon. Thank you in advance.
Replies To: I wanted to transfer data from listview1 to listview2 when clicked
#2
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 02:37 AM
#3
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 02:43 AM
#4
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 02:55 AM
As the screenshots look like .Net, check out this link as a starting point.
This post has been edited by maj3091: 25 December 2012 - 02:59 AM
#5
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 02:55 AM
can u tell me .. are u going to copy data over a single form or there are two forms.
#6
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 03:00 AM
#7
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 03:07 AM
maj3091, on 25 December 2012 - 02:55 AM, said:
Just the data that clicked.. i mean the whole row and the data example :
if user click item no '5464' ... copy the whole row including item name, price and ect
kai_itz me, on 25 December 2012 - 02:55 AM, said:
can u tell me .. are u going to copy data over a single form or there are two forms.
just copy single data that clicked from listview1 to listview2....
maj3091, on 25 December 2012 - 02:55 AM, said:
As the screenshots look like .Net, check out this link as a starting point.
Cool but that link is about copy a listview to another listview... i just want to copy a data that is clicked.
#9
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 03:48 AM
http://vbcity.com/forums/t/132841.aspx
#10
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 03:56 AM
If you added the project source code, then you need to right-click on the project and select Add Reference..., select the Projects tab, and choose the ListView project.
#11
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 04:20 AM
#12
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 05:22 AM
imchivaa, on 25 December 2012 - 10:07 AM, said:
It is for copying all listviewitems, but you should be able to adapt it using the selected index of the item that is clicked in your source list view.
#13
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 05:33 AM
I tired to import the library, but i get 3error
*Type 'ListItem' is notdefined
*Error 2 'ListItems' is not a member of 'System.Windows.Forms.ListView'.
*Error 3 'SubItems' is not a member of 'System.Windows.Forms.ListView.SelectedListViewItemCollection'.
http://www.vbforums....nother-listview
kai_itz me, on 25 December 2012 - 04:20 AM, said:
Hye kai_itz me :
Thank you a bunch man! It's working...
Just this simple code :
For Each item As ListViewItem In Me.ListView1.SelectedItems
item.Remove()
Me.ListView2.Items.Add(item)
Next
And maj3091, thanks for respond for my help. Thanks you both.
Now i am facing another problem, it remove the item before adding it to listview2.
For Each item As ListViewItem In Me.ListView1.SelectedItems
item.Remove()
Me.ListView2.Items.Add(item)
Next
How to prevent it from removing it and add it to the listview2?
#14
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 25 December 2012 - 05:40 AM
item.Remove()
Me.lv1.Items.Add(item)
Next
ListView3.Refresh() 'Not working
when i click an item in listview3.. it remove the item from listview3 and add it to lv1.
but when you refresh listview3... all item display back
so i added this code after the next
listview3.update() but it's not working
#15
Re: I wanted to transfer data from listview1 to listview2 when clicked
Posted 26 December 2012 - 12:47 AM
Quote
item.Remove()
Me.ListView2.Items.Add(item)
Next
How to prevent it from removing it and add it to the listview2?
ACTUALLY THIS CODE WORKS AS CUT AND PASTE..
if u try removing
item.Remove()
IT GIVES U ERROR:
Cannot add or insert the item 'WHATEVER' in more than one place. You must first remove it from its current location.
so i will suggest u to use clone()
For Each item As ListViewItem In Me.ListView1.SelectedItems
item.Clone()
Me.ListView2.Items.Add(item.Clone())
Next
it will work for u ....
This post has been edited by kai_itz me: 26 December 2012 - 01:35 AM
|
|

New Topic/Question
Reply



MultiQuote





|