tags:

views:

42

answers:

1

I try to convert string to ListViewItem:

ListViewItem str = (ListViewItem)Convert.ChangeType(az, typeof(ListViewItem));

but it doesn't work. What is wrong in this code?

+7  A: 

I am not sure I get why you are trying to change the type of a string to ListViewItem. I'm pretty sure that what you actually want to do is create a ListViewItem out of a string using regular construction:

ListViewItem item = new ListViewItem(az);
Jim Brissom
Thanks for help.
luc