title: Can listbox be displayed as a table
body: <p>I have listbox item in my windows store app. When i am getting data from mysql database it is not looking nice. Shows in screenshot</p>
  
  <p><img src="https://i.stack.imgur.com/RWwT2.jpg" alt="enter image description here"></p>
  
  <p>I want to display it as a table and with clear formatting</p>
  
  <p>here is my XAML code for the listbox</p>
  
  <pre><code>&lt;ListBox x:Name="listbox2" HorizontalAlignment="Left" Height="253" Margin="564,60,0,0" Grid.Row="1" VerticalAlignment="Top" Width="397" d:IsHidden="True"&gt;
          &lt;ListBoxItem x:Name="itm"/&gt;
      &lt;/ListBox&gt;
  </code></pre>
  
  <p>and here is my C# code for the view button</p>
  
  <pre><code>private void Button_Click(object sender, RoutedEventArgs e)
      {
          try
          {
              string Query = @"SELECT * FROM `bcasdb`.`tbl_department`;";
              //This is command class which will handle the query and connection object.
              MySqlConnection conn = new MySqlConnection(BCASApp.DataModel.DB_CON.connection);
              MySqlCommand cmd = new MySqlCommand(Query, conn);
              MySqlDataReader MyReader;
              conn.Open();
              MyReader = cmd.ExecuteReader();// this query will be executed and data saved into the database.           
              while (MyReader.Read())
              {
                  //this.branchIDInput.Text = MyReader.GetString(1);
                      ListBoxItem itm = new ListBoxItem();
                      itm.Content = MyReader.GetString(0) + "         " + MyReader.GetString(1) + "       " + MyReader.GetString(2);
                     this.listbox2.Items.Add(itm);
                  //ListBox a = new ListBox();
                  // a.Items.Add();
                      //ListViewItem ad = new ListViewItem();
  
  
              }
              conn.Close();               
          }
          catch (Exception)
          {
              errormsgBox();
          }
      }
  </code></pre>