Firemonkey LiveBinding to TListbox to show images

Viewed 115

I'm trying to use LiveBindings with TListbox. This works with TListview but not TListbox. I'm trying to display only images in a TListbox (no text) but added CustomerID just to show the LiveBindings works. Just that the image does not display from the CustomerPhoto blob field.

LinkFillControlToField1.Control := Listbox1;
with LinkFillControlToField1 do
begin
  FillExpressions.Clear;
  with FillExpressions.AddExpression do
  begin
    SourceMemberName := 'CustomerPhoto';
    ControlMemberName := 'Bitmap';  // no error, means ControlMember exists
  end;
  with FillExpressions.AddExpression do
  begin
    SourceMemberName := 'CustomerID';  // just added this for testing
    ControlMemberName := 'Text';  // displays correct
  end;
end;

The Bitmap in TListview seems to be directly in it, whereas the 'Bitmap' of TListbox is in ItemData of the TListboxitem - could this be the issue?

Is there anything else to do to make the bitmap appear in TListbox, given that it's so automatic in TListview?

0 Answers
Related