Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making ListView scrollable in vertical direction

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?

like image 378
Ravisha Avatar asked Feb 22 '10 05:02

Ravisha


2 Answers

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);
like image 53
NileshChauhan Avatar answered Sep 28 '22 07:09

NileshChauhan


I think the only way to force the ListView scroll vertically and view items as "Title" mode, is this :

ListView.View = View.Details;
ListView.HeaderStyle = ColumnHeaderStyle.None;

and add JUST ONE Column

like image 22
Sepehr Shojaee Avatar answered Sep 28 '22 06:09

Sepehr Shojaee