[2005] listview selected index
how to change the selected index of a listview's subitems(1)?
Because this code doesnt work;
Code:
Listview1.Items(Listview1.SelectedItems(0).Index).SubItems(1).Text = "HELLO"
error is:
InvalidArgument=Value of '1' is not valid for 'index'
Parameter name: index
Re: [2005] listview selected index
Haven't we been through this before? Do NOT, I repeat NOT, do this:
vb.net Code:
Listview1.Items(Listview1.SelectedItems(0).Index)
when this gives EXACTLY the same result:
vb.net Code:
Listview1.SelectedItems(0)
As for your question, if you haven't added any subitems to the item in the first place then you can't set their Text properties. Something that doesn't exist doesn't have any Text property.