TMS iCL DEVELOPERS GUIDE - TMS Software
TMS iCL DEVELOPERS GUIDE - TMS Software
TMS iCL DEVELOPERS GUIDE - TMS Software
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>TMS</strong> SOFTWARE<br />
<strong>TMS</strong> <strong>iCL</strong><br />
<strong>DEVELOPERS</strong> <strong>GUIDE</strong><br />
As explained, each label has the same color, font and text based on the template control of the item<br />
element. To modify these default values dynamically, we will need to implement an event that<br />
manages this. The OnApplyItemValue event is called with a section and row parameter and allows<br />
you to modify the value of the item. There are also equivalents for the header and footer that will be<br />
demonstrated after adding a template control to the header as well.<br />
The code below shows how to access the label with a special helper function that is available in the<br />
FMX.<strong>TMS</strong>NativeUICollectionView unit to detect if the template control is a Label control. Each<br />
control inherits from the base control and is passed as a parameter of this event.<br />
procedure TForm1.<strong>TMS</strong>FMXNativeUICollectionView1ApplyItemValue(Sender:<br />
TObject;<br />
AControl: T<strong>TMS</strong>FMXNativeUICollectionViewTemplateControl; ASection,<br />
ARow: Integer);<br />
begin<br />
if IsLabel(AControl) then<br />
AsLabel(AControl).Text := 'Item ' + inttostr(ASection) + ':' +<br />
inttostr(ARow);<br />
end;<br />
134