I have an application which consumes several web services.
What I'm trying to do is once this service is called, which should give me a list of project names, I'd like to add them to a ListView
and that the user can choose which project to use.
When I run my code, I get the following error:
Additional information: InvalidArgument=Value of '0' is not valid for 'index'.
Here is my code, could you tell me how I can make it work?
ProjectMetaData[] pr = GetProjectMetaData();
foreach (ProjectMetaData proj in pr)
{
var listViewItem = new ListViewItem(proj.ProjectID);
listView1.Items.Add(listViewItem);
}
projectTitle = this.listView1.SelectedItems[0].Index.ToString();
the projectTitle variable is a getter outside the main:
string projectTitle { get; set; }
Thank you very much