Member Avatar for Gamer0077

Hello everyone,

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: '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?)

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 this.

MyListView.Items.Add("Column1Text").SubItems.AddRange(row1); This gives me the same error for SubItems

It's hard for me to explain, so if something isn't clear you can ask.

Gamer0077

Edit: I'm using Visual Studio 2010

Member Avatar for Gamer0077

Hi Mitja Bonca,
I've already added the namespace System.Windows.Controls. Listview is a standard WPF control and the ListView is working, but not fully working.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.