How to create a display that combines a CheckedListBox and a detailed ListView?

I am trying to create something like this:

enter image description here

This example creates a tab-spaced view. The disadvantage of this is that I can experience too long recordings, which I don’t know how it can be in my situation.

How can I create something like this in C #? I wanted to use a ListView, but I also need a checkbox, so I tried CheckedListBox, but then I can not create columns.

How can I create something that is a combination of the two?

+4
source share
2 answers

what is the problem when using ListView for which you enable checkboxes?

ListView.CheckBoxes Property

+6
source

If you create your columns in a list view using -2 as the width, the columns will be automatically sorted.

For instance:

  listView1.View = View.Details; listView1.CheckBoxes = true; listView1.Columns.Add("Col1", -2, HorizontalAlignment.Left); listView1.Columns.Add("Col2", -2, HorizontalAlignment.Left); listView1.Columns.Add("Col3", -2, HorizontalAlignment.Left); ListViewItem oItem = new ListViewItem(); oItem.Text = "Col1 Text"; oItem.SubItems.Add("Col2 Text"); oItem.SubItems.Add("Col3 Text"); listView1.Items.Add(oItem); 
+5
source

Source: https://habr.com/ru/post/1385236/


All Articles