title: Binding items into ListBox multiple columns
body: <p>I am trying to add my data into multiple columns ListBox, I did it but I am facing a hard problem when trying to retrieve the Data from the list box. is there a way to put an object instead of text into a listBox row?</p>
  
  <pre><code>&lt;ListView Name="listBox1" ItemsSource="{Binding Items}" Margin="28,28,68,67" FlowDirection="RightToLeft" MouseDoubleClick="listBox1_MouseDoubleClick"&gt;
          &lt;ListView Name="listBox1" ItemsSource="{Binding Items}" Margin="28,28,68,67" FlowDirection="RightToLeft" MouseDoubleClick="listBox1_MouseDoubleClick"&gt;
          &lt;ListView.View&gt;
              &lt;GridView&gt;
                  &lt;GridView.Columns&gt;
                      &lt;GridViewColumn Header="a" Width="100" DisplayMemberBinding="{Binding Path=ID}" /&gt;
                      &lt;GridViewColumn Header="b" Width="100" DisplayMemberBinding="{Binding Path=Name}" /&gt;
                      &lt;GridViewColumn Header="c" Width="100" DisplayMemberBinding="{Binding Path=F}" /&gt;
                  &lt;/GridView.Columns&gt;
              &lt;/GridView&gt;
          &lt;/ListView.View&gt;
      &lt;/ListView&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>and this is the code</p>
  
  <pre><code> public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
      }
      public sealed class MyListBoxItem
      {
          public string Field1 { get; set; }
          public string Field2 { get; set; }
          public string Field3 { get; set; }
      }
  
      private void Window_Loaded(object sender, RoutedEventArgs e)
      {
          Students st = new Students(1, "name","anything");
          listBox1.ItemsSource = new List(new[] { st });
      }
  
      private void listBox1_MouseDoubleClick(object sender, MouseButtonEventArgs e)
      {
          object ob = listBox1.SelectedItem;
          string i = ((MyListBoxItem)listBox1.SelectedItem).Field1;
      }
  }
  </code></pre>
  
  <p>and here is the class Students</p>
  
  <pre><code> class Students
  {
      int id;
      string name;
      string f;
  
      public Students(int id, string name,string f)
      {
          this.id = id;
          this.name = name;
          this.f = f;
      }
      public int ID
      {
          get { return id; }
          set { id = value; }
      }
      public string Name
      {
          get { return name; }
          set { name = value; }
      }
      public string F
      {
          get { return f; }
          set { f = value; }
      }
  }
  </code></pre>