Making ListView scrollable in vertical direction

Ravisha picture Ravisha · Feb 22, 2010 · Viewed 76.5k times · Source

I am using a System.Windows.Forms.ListView with checkboxes = true. I can see that when the list items are more than what can fit, I get a horizontal scroll bar. I tried to find any properties to change scroll bar orientation. Is there any way to make it scrollable in vertical direction?

Answer

NileshChauhan picture NileshChauhan · Feb 22, 2010

You need to Set

Listview1.Scrollable = true;
Listview1.View = View.Details

This will only work correctly if you have added some columns in your Listview1, So add a dummy column. like,

ColumnHeader header = new ColumnHeader();
header.Text = "";
header.Name = "col1";
listView1.Columns.Add(header);