C # usage of listview

Source: Internet
Author: User

Private void InitListView () {# region adds the Item topic. There are three columns // 1 and region creation topic. There are three columns in total: listView1.View = View. details; listView1.Columns. add ("file name"); listView1.Columns. add ("size"); listView1.Columns. add ("creation date"); listView1.BeginUpdate (); # Add the first Item in region // 2. Define a ListViewItem in View. in Details mode, it is like a value in the first column ListViewItem lvItem; // 3. Define ListViewSubItem in View. in Details mode, it is a bit like a value in the second column ListViewItem. listViewSubItem lvSubItem; // list an Item in View. detail In s mode, the point is like adding the first value of the first line lvItem = new ListViewItem (); // The text lvItem displayed by the Item. text = "file lifecycle 1"; // 4. Add Item to the ListView control, that is, add the first line. In View. in Details mode, the first value of listView1.Items is added to the first column of the First intent. add (lvItem); // practically SubItemlvSubItem = new ListViewItem. listViewSubItem (); lvSubItem. text = "10"; // 5. Add the SubItem to the first Item. in Details mode, it is a bit like adding the first lvItem in the second column of the first category. subItems. add (lvSubItem); lvSubItem = new ListViewItem. listViewSubItem (); lvSubItem. text = "20080114"; // Add the SubItem to the first Item. in Details mode, it is a bit like adding the first lvItem in the third column of the first category. subItems. add (lvSubItem); # endregionlvItem = new ListViewItem (); lvItem. text = "file limit 2"; lvSubItem = new ListViewItem. listViewSubItem (); lvSubItem. text = "20"; lvItem. subItems. add (lvSubItem); lvSubItem = new ListViewItem. listViewSubItem (); lvSubItem. text = "20080115"; lvItem. subItems. add (lvSubItem); listView1.Items. add (lvItem); # endregionlistView1.EndUpdate ();}

 

650) this. width = 650; "title =" qq 30812232203.jpg "src =" http://www.bkjia.com/uploads/allimg/131228/20093B639-0.jpg "/>,

 

This article is from the "Feng qing yang song" blog, please be sure to keep this source http://2309998.blog.51cto.com/2299998/1271670

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.