move values from 1 listview to another in C# 2008 WPF

I have a WPF C# application (NOTweb based)

I am trying to create an interface where the user gets a list of freelancers in a listview (listViewFreelancers).
They can choose freelancers and press a button (buttonSelect) which moves them into a 2nd listview (listViewSelected) to show them what they have selected.
Once they have finished selecting they will press a 2nd button (buttonSend) which will an e-mail to all of the freelancers which were selected.
I have used LINQ to SQL to bind a listview called listViewFreelancers to a LINQ query.
(there are multiple columns, the 1st column being the row_id)

I now need to take the selected rows from listViewFreelancers and move them into listViewSelected. I then need to read them out of listViewSelected so that I can e-mail them.

1) I can't figure out the code to move the selected items from 1 listview to another
2) I don't know how to read the items out of the listViewSelected once they are ready to e-mail the freelancers.

Can someone help ?


bookITDataContext db = new bookITDataContext();
var queryFreelancers = from p in db.Freelancer_basics
             select p;
// binding my listview to the results of the query
this.listViewFreelancers.ItemsSource = queryFreelancers;

Open in new window

Who is Participating?
Jon-GConnect With a Mentor Author Commented:
Thanks for the response.

That much I had gotten working.
I had a mulit-column listview which I was battling to read items out of.
Eventually got it right. :)

Does this help to get you started?

<Window x:Class="WpfApplication1.Window1"
    Title="Window1" Height="355" Width="477">
        <ListView HorizontalAlignment="Left" Margin="107,126,0,38" Name="listView1" Width="120" />
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WpfApplication1
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
        public Window1()
            StringBuilder a = new StringBuilder("AAA");
            StringBuilder b = new StringBuilder("BBB");
            StringBuilder c = new StringBuilder("CCC");
            foreach (StringBuilder item in listView1.Items)

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.