Results 1 to 5 of 5

Thread: [RESOLVED] Data from listview to be loaded to another listview but different forms.

  1. #1

    Thread Starter
    Hyperactive Member shyguyjeff's Avatar
    Join Date
    Jul 2007
    Location
    City of Durian
    Posts
    289

    Resolved [RESOLVED] Data from listview to be loaded to another listview but different forms.

    Hello everyone..I am having a problem regarding to pass all the data on the listview from one form to another and add another columns. The purpose of my columns is that I want to put text from there because I am sending a mail but I want to get the status of my message if it failed or send and write it at every end of the rows.
    Last edited by shyguyjeff; Apr 21st, 2009 at 05:24 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Data from listview to be loaded to another listview but different forms.

    In what sense are you having trouble? You simply get the data out of the first ListView, pass it to the second form and then add it to the second ListView. What part of the process is giving you pause?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member shyguyjeff's Avatar
    Join Date
    Jul 2007
    Location
    City of Durian
    Posts
    289

    Re: Data from listview to be loaded to another listview but different forms.

    Hello jm.. Hmmm I am having trouble on how to pass that data exactly what is the data from listview of the firstform. But anyway I got it already..

    I use..


    Dim itemClone As ListViewItem
    Dim coll As ListView.ListViewItemCollection = listView1.Items
    For Each item As ListViewItem In coll
    itemClone = TryCast(item.Clone(), ListViewItem)
    listView1.Items.Remove(item)
    listView2.Items.Add(itemClone)
    Next

    Thanks jm...
    Last edited by shyguyjeff; Apr 21st, 2009 at 02:50 AM.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [RESOLVED} Data from listview to be loaded to another listview but different form

    If you're removing the items from the first ListView then why do you need the clone? Just move the items from one to the other.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Hyperactive Member shyguyjeff's Avatar
    Join Date
    Jul 2007
    Location
    City of Durian
    Posts
    289

    Re: [RESOLVED} Data from listview to be loaded to another listview but different form

    I did not remove actually the first listview jm. I remove already the listView1.Items.Remove and load another form. I will make a logs from it, but I have a problems making my log now jm on how to add a text to the every rows on existing data. This what I want, I have a mail program and I want to loop all emails on my listview. And now I want to put a text to the next column of every row if the message I send is successful and if it returns not successful the error will be add to the row.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width