Reputation: 2490
Is there any way to get a list view to display vertically? Rigth now for my list view, the view is "List", but if there are too many entries, then you have to scroll to the right to view the rest, I just want to be able to scroll down to see the rest.
I tried all the other options, but they don't seem to work.
Any ideas?
Upvotes: 0
Views: 3413
Reputation: 30721
I think to get the effect you want, you need to set the view to "Details", then add a single column (either through the designer or in code).
This is what I do in mine:
SelectionList.View = View.Details;
SelectionList.HeaderStyle = ColumnHeaderStyle.None;
SelectionList.Columns.Add(new ColumnHeader { Width = SelectionList.ClientSize.Width - SystemInformation.VerticalScrollBarWidth });
Then to add items:
foreach (var item in _collectionOfSomething)
{
SelectionList.Items.Add(new ListViewItem(item.ItemName) {Tag = item.Ident});
}
Upvotes: 1