Reputation: 302
I have a FireMonkey form with the Tlistview component on it. It has a Tlayout as its parent. I want the items in the list should not fill the whole layout it is in, instead, it should fit in the half of width of its parent layout and when the items reach the bottom of the layout it should go to the next column.
In the Tlistbox component (not TlistView) there's a property named 'ListStyle' which can be set to 'vertical' or 'horizontal', this is just what I'm looking for in Tlistview component.
Any help would be greatly appreciated.
Upvotes: 1
Views: 602
Reputation: 1814
For this purpose, the TListBox is more suitable. Here you have the property Columns
. Set ListBox.Columns := 2
and you see two parallel lists.
Be aware it is not sorted as you requested, but you can sort the items by using the ListBoxItem.Index
or by calling the method ListBox1.Sort(ComparerFuncfunction (Left, Right: TFmxObject): Integer)
.
TListView
has no possibility to display more columns. If TListView is needed, I would place several TListViews next to each other within a layout and distribute the elements themselves to the views, or regroup them in case of a resize.
Upvotes: 1