I have a ListView in my aspx file like this:
<asp:ListView ID="ListView1" runat="server"></asp:ListView>
and then I have List like this:
List<string> mylist = new List<string>();
Im trying to populate the ListView like so:
foreach(string elem in mylist)
{
ListView1.Items.Add(new ListViewItem(elem));
}
But my compiler is telling me best overload match error & cannot convert string to ListViewItem. This is a asp.net 4.0 web app. Any suggestions?