Checkbox in listview control

后端 未结 8 1684
既然无缘
既然无缘 2020-12-20 13:20

Can you have a multicolumn listview control where one of the columns is a checkbox? Example code or links would be greatly appreciated.

I am using visual studio 200

相关标签:
8条回答
  • Better use grid view control, but if you want only one column with checkboxes and that column is the first one you can just write:

    this.listView1.CheckBoxes = true;
    
    0 讨论(0)
  • 2020-12-20 13:42

    Add Checkbox column like below.

    myListView.CheckBoxes = true;
    myListView.Columns.Add(text, width, alignment);
    

    Add ListViewItem s like below.

    ListViewItem lstViewItem = new ListViewItem();
    lstViewItem.SubItems.Add("Testing..");
    lstViewItem.SubItems.Add("Testing1..");
    
    myListView.Items.Add(lstViewItem);
    
    0 讨论(0)
提交回复
热议问题