Question

When i add a listview to my form and in form load event i write below code , items added in the same row not in separated rows , how can i add them to separated rows

            listView1.MultiSelect = true;
            listView1.CheckBoxes = true;
            listView1.Items.Add("Item 1");
            listView1.Items.Add("Item 22");
            listView1.Items.Add("Item 333");
Was it helpful?

Solution

try this out

listView1.View = View.List;

OTHER TIPS

Taking a stab at this, I'd suggest that it's because your ListView is defaulting to small icons or tiles. Try adding this line anywhere there:

listView1.View = View.Details;

Are you sure ?
Normally, with this code, you should have added 3 items, and you should see 3 rows when the View property of the ListView is set to Details

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top