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);
listView1.Items.Add(lvi);
What am I doing wrong.
Thanks in advance.
Loading
VulpesPosted Mar 15, 2011, 3:02 PM
Sam HobbsPosted Mar 15, 2011, 7:14 PM
IainPosted Mar 15, 2011, 6:59 PM
I shall take more care where I post in future.
It is a struggle getting through the documentation for someone learning this like myself. I shall try and understand it better before posting in future.
Thanks for your help, it's appreciated.
Sam HobbsPosted Mar 15, 2011, 3:25 PM
IainPosted Mar 15, 2011, 1:39 PM
This is the error I get in the output window
Sam HobbsPosted Mar 14, 2011, 7:56 PM
FroglegPosted Mar 14, 2011, 6:58 PM
ListViewItem lvt = new ListViewItem(item name);
lvt.Tag = (item name);
lvt.Text = (item name);
listView1.Items.Add(lvt);
Upload your whole project if you can't make it work
IainPosted Mar 14, 2011, 6:47 PM
I should have probably called it something different but it suited my needs at the time
FroglegPosted Mar 14, 2011, 6:43 PM