Split a listview into multiple columns

I am populating a ListView with a DataTable from the code behind. The problem is, that the ListView is becoming too long with too many items.

I am wondering, how can I make this:

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6

Into this:

Item 1  Item 4
Item 2  Item 5
Item 3  Item 6

Maybe I'm overlooking something, but I can't seem to find the answer.

Please not that I want to keep it in one ListView, so I'm not looking to split the items and put them into multiple ListViews.

Solution: Use a DataList in stead of a ListView. See Tim's answer.


Use a DataList instead. It has a RepeatDirection and RepeatColumns properties. The former would be RepeatDirection.Vertical and the latter 2 in your case.

Gets or sets the number of columns to display in the DataList control.

链接地址: http://www.djcxy.com/p/27826.html

上一篇: 我如何获得PreparedStatement的SQL?

下一篇: 将列表视图拆分为多个列