In Focus

Forums - C# Corner

Forum guidelines


  • 1.5k
  • 7
  • 18.6k

listviewitem constructor problem

Mar 14 2011 6:25 PM
Hi All,
I'm learning c# so apologies if this is a stupid question

I get the error 'listviewitem does not contain a constructor that takes 1 arguments'.

The code I'm using is the following

            string[] lViewItem = new string[2];

            foreach (Collect c in collect)
                lViewItem[0] = c.Id.ToString();
                lViewItem[1] = c.Name;

                ListViewItem lvi = new ListViewItem(lViewItem);


What am I doing wrong.

Thanks in advance.

Answers (9)


Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now