How do I adjust the size of items in a Tlistview

Asked

Viewed 1,110 times

0

I’d like to ask you for help about a difficulty I’m facing.

The TListView is with the configuration of Appearance as DynamicAppearance.

Lista com produtos

I would like to break from the products that have additional, for example, the first product has 2 additional and I would like to break the line for each additional and resize the list line.

1 answer

0

To break the additional products you can replace the comma with a Chr(13), for example. I don’t know if the text is created by you or not, but if it’s not, you can use a Replacestr(Detail,','Chr(13))

As for item height, each Tlistview item has a property Height that you can change, and then some get bigger than others. Maybe you can count the number of commas or additional products and increase the X% line for each one.

  • When I modify the height size it does not modify visually.. The code I am using is this:

  • lvCarrinho.Items[lvCarrinho.Selected.Index].Objects.Findobjectt<Tlistitemtext>('additional'). Height := lvCarrinho.Items[lvCarrinho.Selected.Index].Objects.FindObjectT<TListItemText>('adicionais'). Height * cdsCarrinhoAdicionais.RecordCount;

  • You can put the Listview fill-in code?

  • The list is linked with the date set by the bind visually. So I just fill in the date set and reload.

  • I don’t usually use bindings, but I assume that then after you fill out the dataset, you can do a Tlistview for items and do what I indicated earlier. Try changing the full height of the ITEM (lvCarrinho.Items[lvCarrinho.Selected.Index]. Height) and not the Details item in specifics (lvCart.Items[lvCart.Selected.Index].Objects.Findobje ctt<Tlistitemtext>(' additional'). Height)

  • I tried to modify only the height of the item as specified, but I did not find results, although the number is changed on the screen does not change anything..

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.