title: How To Add Subitem in ListViewItem in WPF C#
body: <p>I want to import data From excel datasheet to listview in WPF.
  I want to add item and subitem to listviewitem.
  If in Windows Form code:</p>
  
  <pre><code>foreach(DataRow drow in dtblImport.Rows)
  {
    ListViewItem lvi = new ListViewItem();
    lvi.DataContext = drow[0].ToString();
  
     foreach(DataColumn dcol in dtblImport.Column)
      {
        if(drow[dcol.Ordinal] != DBNull.Value){
        lvi.SubItem.Add(drow[dcol.Ordinal].ToString());}
        else {       
        lvi.SubItem.Add("");}
      }
     ListView.Items.Add(lvi);
  
  }
  </code></pre>
  
  <p>But how if i want do it in WPF? Thanks</p>