How can I add items to DynamicAppearance Listview in runtime? On design mode I created the layout of ListView which I want. I added 3 TTextObjectAppearance. How can I set those 3 TTextObjectAppearance text dynamically?
I took the time to format the answer that was posted in the original question's comments by the original poster.
var list : TListViewItem;
ldes, lOrder, lLegal : TListItemText;
begin
list := ListView1.Items.Add;
ldes := list.Objects.FindObjectT<TListItemText>('Description');
lOrder := list.Objects.FindObjectT<TListItemText>('OrderId');
lLegal := list.Objects.FindObjectT<TListItemText>('LegalCode');
ldes.Text := 'Mouri';
lOrder.Text := 'Love';
lLegal.Text := 'You'
end;
Another way to change the text would be:
for i := 0 to Listview1.Itemcount-1 do begin
Listview1.Items.AppearanceItem[i].Data['Description'] := 'Mouri';
Listview1.Items.AppearanceItem[i].Data['OrderID'] := 'loves';
Listview1.Items.AppearanceItem[i].Data['LegalCode'] := 'YOU!';
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With