views:

463

answers:

3

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");
+2  A: 

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;
Matt Hamilton
+1  A: 

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

Frederik Gheysels
+2  A: 

try this out

listView1.View = View.List;