Delphi TListview and TLinkControlToField issues – cannot customise individual rows

I’m trying to use TLinkControlToField binding with TListview, with the event OnFilledListItem of TLinkControlToField.

However, as the data is filled in the TListview, I am able to customise the TListItemText but not the TListItemTextButton.

TForm1 = class(TForm)
  ListView1: TListView;
  PrototypeBindSource1: TPrototypeBindSource;
  BindingsList1: TBindingsList;
  LinkFillControlToField1: TLinkFillControlToField;
  procedure LinkFillControlToField1FilledListItem(Sender: TObject;
    const AEditor: IBindListEditorItem);
private
  FInteger: Integer;
public
  { Public declarations }
end;


procedure TForm1.LinkFillControlToField1FilledListItem(Sender: TObject;
  const AEditor: IBindListEditorItem);
begin
  var LItem := AEditor.CurrentObject as TListViewItem;

  var LTextObject := LItem.Objects.FindDrawable('Text1') as TListItemText;
  if Assigned(LTextObject) then
  begin
    LTextObject.Text := FInteger.ToString;
    LTextObject.Visible := (FInteger mod 2) = 0;  // does not hide
    if not LTextObject.Visible then
      LTextObject.Text := ''; // have to resort to .Text = empty to hide
  end;

  var LButtonObject := LItem.Objects.FindDrawable('TextButton2') as TListItemTextButton;
  if Assigned(LButtonObject) then
  begin
    LButtonObject.Text := 'test' + FInteger.ToString;
    // just make alternate rows invisible for testing purpose
    LButtonObject.Visible := (FInteger mod 2) = 0;  // does not make it invisible
    if not LButtonObject.Visible then
    begin
      LButtonObject.Height := 0.1;  // does not work!
      LButtonObject.Width := 0.1; // does not work!
    end;
  end;

  Inc(FInteger);
end;

You can copy and paste these components for convenience:

object ListView1: TListView
  ItemAppearanceClassName = 'TDynamicAppearance'
  ItemEditAppearanceClassName = 'TDynamicAppearance'
  HeaderAppearanceClassName = 'TListHeaderObjects'
  FooterAppearanceClassName = 'TCustomizeItemObjects'
  Position.X = 744.000000000000000000
  Position.Y = 120.000000000000000000
  Size.Width = 257.000000000000000000
  Size.Height = 401.000000000000000000
  Size.PlatformDefault = False
  TabOrder = 4
  ItemAppearanceObjects.ItemObjects.ObjectsCollection = <
    item
      AppearanceObjectName = 'Text1'
      AppearanceClassName = 'TTextObjectAppearance'
      Appearance.TextShadow.Color = claSlategray
      Appearance.Width = 79.000000000000000000
      Appearance.Height = 44.000000000000000000
    end
    item
      AppearanceObjectName = 'TextButton2'
      AppearanceClassName = 'TTextButtonObjectAppearance'
      Appearance.TextColor = claSlategray
      Appearance.TintColor = claSteelblue
      Appearance.Width = 50.000000000000000000
      Appearance.Align = Trailing
      Appearance.VertAlign = Center
      Appearance.Text = 'Edit'
    end>
  ItemAppearanceObjects.ItemEditObjects.ObjectsCollection = <
    item
      AppearanceObjectName = 'Text1'
      AppearanceClassName = 'TTextObjectAppearance'
    end>
end

object PrototypeBindSource1: TPrototypeBindSource
  AutoActivate = True
  AutoPost = False
  RecordCount = 5
  FieldDefs = <
    item
      Name = 'CustomerID'
      FieldType = ftInteger
      Generator = 'UIntegers'
    end
    item
      Name = 'CustomerType'
      FieldType = ftUInteger
      Generator = 'UIntegers'
    end>
  ScopeMappings = <>
  Left = 688
  Top = 184
end

Am I using OnFilledListItem wrongly? I need to customize each row. I have partial success with the Text in TListview but not the TextButton of TListview.

Is there possibly a bug in the TextButton portion?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật