Thanks for your fast answer.
In a new HD desktop FireMonkey application, put on the form a TTmsFmxGrid and a TAdapterBindSource and bind them together (i
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, Data.Bind.EngExt,
Fmx.Bind.DBEngExt, FMX.TMSGridDataBinding, System.Rtti, System.Bindings.Outputs, Fmx.Bind.Editors,
Data.Bind.Components, Data.Bind.Grid, Data.Bind.ObjectScope, FMX.TMSBaseControl, FMX.TMSGridCell,
FMX.TMSGridOptions, FMX.TMSGridData, FMX.TMSCustomGrid, FMX.TMSGrid, FMX.Types, FMX.Controls,
FMX.StdCtrls, System.Generics.Collections, Fmx.Bind.Grid, FMX.Layouts, FMX.Grid, FMX.Forms;
type
TPerson = class
private
FName: string;
FFirstName: string;
public
property Name: string read FName write FName;
property FirstName: string read FFirstName write FFirstName;
constructor Create(N, P: string);
end;
TForm1 = class(TForm)
Panel1: TPanel;
AdapterBindSource1: TAdapterBindSource;
BindingsList1: TBindingsList;
Grid1: TGrid;
TMSFMXGrid1: TTMSFMXGrid;
LinkGridToDataSourceAdapterBindSource12: TLinkGridToDataSource;
LinkGridToDataSourceAdapterBindSource13: TLinkGridToDataSource;
procedure AdapterBindSource1CreateAdapter(Sender: TObject;
var ABindSourceAdapter: TBindSourceAdapter);
private
{ Déclarations privées }
FList: TObjectList<TPerson>;
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
procedure TForm1.AdapterBindSource1CreateAdapter(Sender: TObject;
var ABindSourceAdapter: TBindSourceAdapter);
begin
FList:= TObjectList<TPerson>.Create(False);
with FList do
begin
Add(TPerson.Create('Dupond', 'Xavier'));
Add(TPerson.Create('Rousseau', 'Herve'));
Add(TPerson.Create('Henri', 'Jacques'));
end;
ABindSourceAdapter:= TListBindSourceAdapter<TPerson>.Create(Self, FList, False);
end;
{ TPerson }
constructor TPerson.Create(N, P: string);
begin
inherited Create;
FName:= N;
FFirstName:= P;
end;
end.