listView save and get

 

save:

            ListViewItem lv = new ListViewItem();
            lv.SubItems[0].Text = "Text1";
            lv.SubItems.Add("Text1subtext");
            this.listView1.Items.Add(lv);

 

            ListViewItem lv2 = new ListViewItem();
            lv2.SubItems[0].Text = "Text2";
            lv2.SubItems.Add("Text2subtext");
            this.listView1.Items.Add(lv2);

 

get:

           aa1 = listView1.Items[0].SubItems[0].Text;
           aa2 = listView1.Items[0].SubItems[1].Text;

           aa3 = listView1.Items[1].SubItems[0].Text;
           aa4 = listView1.Items[1].SubItems[1].Text;

 

posted @ 2010-01-17 12:46  greencolor  阅读(163)  评论(0编辑  收藏  举报