Using Livebindings to Assign Several Field Values to an FMX MetropolisUI TListBox Item.Text

  

I am coding a FMX Metropolis UI application and trying to assign two field values of type string to the Item.Title member of TListBox by LiveBindings technology (using expression engine).

When I use a TBindList in the following way:

object BindList1: TBindList
Category = ‘Lists’
ControlComponent = ListBox1
SourceComponent = BindSourceDB1
FormatExpressions = <
item
ControlExpression = ‘Text’
SourceExpression =
‘FieldByName(“name1″).Text + ” ” + Field’ +
‘ByName(“name2”).Text’
end>
FormatControlExpressions = <>
ClearControlExpressions = <>
end

It assigns the ‘name1 name2’ string to the member Text but I fail to set the ListItemStyle := MetropolisUI as there is no such property in TBindList class

If I use TLinkFillControlToField

object LinkFillControlToField2: TLinkFillControlToField
Category = ‘Quick Bindings’
Control = ListBox1
Track = True
FillDataSource = BindSourceDB1
FillDisplayFieldName = ‘name1’
AutoFill = True
BufferCount = -1
AutoBufferCount = False
FillExpressions = <>
FillHeaderExpressions = <>
FillBreakGroups = <>
end

it lets me to assign ListItemStyle to MetropolisUI, but there is only one field that I can access with FillDisplayFieldName property and there is no SourceExpression field to assign ‘FieldByName(“name1″).Text + ” ” + FieldByName(“name2”).Text’ to it.

I tried to guess context of Item.Text member of TListBox from TBindList but I did not manage to. I studied Delphi samples but there is no Metropolis TListBox and it seems to act in a different way than the common one. Does anybody have any ideas how to find the solution for this issue?

Comments are closed.