Apply the chekbox status of listview to the subnode

Source: Internet
Author: User
A post posted on the Forum some time ago. Of course, listview can also implement a hierarchical progressive tree structure. Although it is only appearance and cannot be folded and opened, it can be well implemented to apply the chekbox status to the subnode. As shown in the following figure:

The implementation method is also simple:
  1. // Apply the checked status of the item to the sub-project
  2. Procedure checksubitems (item: tlistitem );
  3. VaR
  4. I: integer;
  5. Begin
  6. For I: = item. index + 1 to listview1.items. Count-1 do
  7. If INTEGER (listview1.items [I]. Data)> INTEGER (item. Data) then
  8. Listview1.items [I]. Checked: = item. Checked
  9. Else
  10. Break;
  11. End;

In the above Code, listview1.items []. data can be considered to store level information (in fact, I use it for other purposes), where calls are needed

The checksubitems function can apply the chekbox status of the tlistitem to the subnode.

.

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.