title: Missing ListView.Columns in WPF
body: <p>I'm writing an application with a ListView in C# WPF. I was wondering if I was missing a reference of something, because I get this error all the time: </p>
  
  <blockquote>
    <p>'System.Windows.Controls.ListView' does not contain a definition for 'Columns' and no extension method 'Columns' accepting a first argument of type 'System.Windows.Controls.ListView' could be found (are you missing a using directive or an assembly reference?)`</p>
  </blockquote>
  
  <p>It's not only with MyListview.Colums but also when I want to add a multi-column item to my ListView, for example by following <a href="https://stackoverflow.com/questions/473148/c-sharp-listview-how-do-i-add-items-to-columns-2-3-and-4-etc/">this</a>.
  <code>MyListView.Items.Add("Column1Text").SubItems.AddRange(row1);</code> This gives me the same error for SubItems</p>
  
  <p>It's hard for me to explain, so if something isn't clear you can ask.</p>
  
  <p><strong>Edit: With a lot of help from you and some Googling skills I found a solution. My XAML code:</strong></p>
  
  <pre><code>&lt;Grid&gt;
      &lt;ListView x:Name="MyListView"
          &lt;ListView.View&gt;
              &lt;GridView x:Name="MyGridView"&gt;
                  &lt;GridViewColumn Header="#" DisplayMemberBinding="{Binding Number}" Width="24" /&gt;
                  &lt;GridViewColumn Header="Song" DisplayMemberBinding="{Binding Song}" Width="390" /&gt;
              &lt;/GridView&gt;
          &lt;/ListView.View&gt;
      &lt;/ListView&gt;
  </code></pre>
  
  <p></p>
  
  <p>and here is how to add an item:</p>
  
  <pre><code>        MyListView.Items.Add(new { Number = 1, Song = "My first song" });
          MyListView.Items.Add(new { Number = 2, Song = "My second song" });
  </code></pre>
  
  <p>This was my first time working with bindings, but I learned a lot!</p>