title: C# ListView Display
body: <p>Guys i'm a beginner in implementing ListView in c#. I'm having a problem with these piece of code in c#.net. And I can't figure out whats happening in the control shown by the output. It seems i forgot something to give a value in properties of ListView Control.</p>
  
  <p>2nd column values must appear on the first column. </p>
  
  <p><img src="https://i.stack.imgur.com/Fcsb4.png" alt="enter image description here"></p>
  
  <p>This is my code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;   
  using System.ComponentModel;
  using System.Data;                  
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;        
  using System.Data.OleDb;            
  namespace Database2
  {
      public partial class Form1 : Form
      {
          OleDbConnection con;
          OleDbDataAdapter adapter;
          DataTable table;
  
          string conString = "Provider = Microsoft.Jet.OLEDB.4.0.; Data Source=DatabaseTest.mdb";
          string sqlQuery = "SELECT * FROM Person";
  
          public Form1() {
              InitializeComponent();
          }
  
          private void Form1_Load(object sender, EventArgs e){
              con = new OleDbConnection(conString);
              adapter = new OleDbDataAdapter(sqlQuery,conString);
              table = new DataTable();
  
              InitializeList();
  
              adapter.Fill(table);
  
              for (int i = 0; i &lt; table.Columns.Count; i++)
                  lstDisplay.Columns.Add(table.Columns[i].ColumnName.ToString(), lstDisplay.Width / 6-1);
  
              for (int i = 0; i &lt; table.Rows.Count; i++) { 
                  ListViewItem row = new ListViewItem();
                 for (int j = 0; j &lt; table.Columns.Count; j++)
                      row.SubItems.Add(table.Rows[i][j].ToString());
                 lstDisplay.Items.Add(row);
              }
          }
  
          private void InitializeList() {
              lstDisplay.GridLines = true;
              lstDisplay.AllowColumnReorder = true;
              lstDisplay.LabelEdit = true;
              lstDisplay.FullRowSelect = true;
              lstDisplay.Sorting = SortOrder.Ascending;
              lstDisplay.View = View.Details;
          }
      }
  }
  </code></pre>
  
  <p>Is there a listView property i forgot to give a value? </p>