c# - ListView AddRange of Items starting from SubItem[1] -


i have listview has populated first column.
can use :

mylistview.items.addrange(new listviewitem[] { item }) 

but since have first column populated, tried using:

mylistview.items[0].subitems.addrange(new listviewitem[] { item }) 

but error: enter image description here

i can use string[] overload, there way use listviewitem[] instead subitems?

here's code:

listviewitem item = new listviewitem(new string[]     {         exp[listbox1.selectedindex].tostring(),         exp2[listbox1.selectedindex].tostring()     }); listview2.items[0].subitems.addrange(new listviewitem[] { item }); 

so why don't do:

listview2.items[0].subitems          .addrange(new [] { exp[listbox1.selectedindex].tostring(),                             exp2[listbox1.selectedindex].tostring(),                           }); 

the method expects either array of strings or listviewsubitems.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -