Page 1 of 1

ApplyRows

Posted: Fri Feb 01, 2019 10:17 am
by thefreecat
Hello,

I am using the demo from XlsRWII/5 "SampleFormatCells".

I try to define a default format :

XLS.CmdFormat.BeginEdit(Nil);
XLS.CmdFormat.Fill.BackgroundColor.RGB := $7F7F10;
XLS.CmdFormat.Font.Name := 'Courier new';
XLS.CmdFormat.AddAsDefault('F1');

...and then apply that format to rows 1 to 5 :

XLS.CmdFormat.BeginEdit(XLS[0]);
XLS.DefaultFormat := XLS.CmdFormat.Defaults.Find('F1');
XLS.CmdFormat.ApplyRows(1,5);

But nothing happens. What is the proper way of applying a default format to several rows ?

Thanks,

JC

Re: ApplyRows

Posted: Sat Feb 02, 2019 2:27 pm
by larsa
Hello

Default formats are only used when you add cells, they will not work with rows.

Re: ApplyRows

Posted: Sat Feb 02, 2019 3:14 pm
by thefreecat
Thanks for your quick answer Lars