Note that there are some explanatory texts on larger screens.

plurals
  1. POPopulating a listview with a csv-file's content including groups
    primarykey
    data
    text
    <p>So you have a csv-list in a textfile and a listview. Fields are</p> <blockquote> <p>Group,Column1,Column2,Column3,Column4,Column5</p> </blockquote> <p>Example(All strings)</p> <pre><code>"Beginning","1","Quiet","Some text","Some other text","c:\...\image.jpg" "Beginning","2","Quiet","Some text2","Some other text2","c:\...\image2.jpg" "Middle","3","Quiet","Some text3","Some other text3","c:\...\image3.jpg" "Middle","4","Running","Some text4","Some other text4","c:\...\image4.jpg" </code></pre> <p>Group is to be a listviewgroup. Column1 a listviewitem, Column2 the 1st subitem of Column1, Column3 the 2nd subitem of Column1, Column4 the 3rd subitem of Column1, Column5 the last subitem of Column1.</p> <p>Group and Column2 are not unique, all other columns are unique.</p> <p>What would be the most efficient way to </p> <ol> <li>read a csv-file list with that structure</li> <li>populate the listview</li> <li>write to the csv-file</li> </ol> <p>What I tried:</p> <pre><code>ListViewGroup k = new ListViewGroup("group1"); ListViewGroup l = new ListViewGroup("group2"); ListViewGroup a = new ListViewGroup("group3"); listView1.Groups.AddRange(new ListViewGroup[] {a, k, l }); ListViewItem item1 = new ListViewItem("column1_1", 0); item1.SubItems.Add("column2_1"); item1.SubItems.Add("column3_1"); item1.SubItems.Add("column4_1"); item1.SubItems.Add("column5_1"); item1.Group=k; listView1.Items.Add(item1); ListViewItem item2 = new ListViewItem("column1_2", 0); ... </code></pre> <p>As a basis. But this method makes automation hard. Especially when there are more groups being reused. So I am looking for a way this is normally done.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload