отвечаю сам на свой вопрос вдруг кому пригодиться
Код | unit Unit1;
interface
uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Grid, FMX.Layouts, FMX.Edit;
type TForm1 = class(TForm) Grid1: TGrid; Column1: TColumn; Column2: TColumn; Column3: TColumn; Column4: TColumn; Edit1: TEdit; procedure FormCreate(Sender: TObject); procedure Grid1GetValue(Sender: TObject; const Col, Row: Integer; var Value: Variant); procedure Grid1ApplyStyleLookup(Sender: TObject); procedure Edit1ApplyStyleLookup(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.fmx}
procedure TForm1.Edit1ApplyStyleLookup(Sender: TObject); begin
// Edit1.Color := claBlueViolet; end;
procedure TForm1.FormCreate(Sender: TObject); var //col : TColumn; Col, Row: Integer; CellCtrl: TStyledControl; begin Edit1.FontFill.Color := claBlueViolet; { col := TCheckColumn.Create(grid1); col.Name := 'CheckColumn'; grid1.AddObject(col); }
end;
procedure TForm1.Grid1ApplyStyleLookup(Sender: TObject); var TC: TTextCell; begin if ( Sender <> nil ) and ( Sender is TTextCell ) then begin TC := TTextCell( Sender );
TC.FontFill.Color := claBlueViolet; TC.Font.Family := 'Times New Roman'; TC.Font.Style := [ TFontStyle.fsBold ]; TC.Font.Size := 25; end; end;
procedure TForm1.Grid1GetValue(Sender: TObject; const Col, Row: Integer; var Value: Variant); var Col1, Row1: Integer; CellCtrl: TStyledControl; begin case Col of 0: Value:='122'; 1: Value:='122'; 2: Value:='122'; 3: Value:='122'; end;
for Col1 := 0 to Grid1.ColumnCount - 1 do begin for Row1 := 0 to Grid1.RowCount - 1 do begin CellCtrl := Grid1.Columns[ Col ].CellControlByRow( Row ); if ( CellCtrl <> nil ) and ( CellCtrl is TTextCell ) then TTextCell( CellCtrl ).OnApplyStyleLookup := Grid1ApplyStyleLookup; end; end; end;
end.
|
всем спасибо за помощь))) |