Web Core 1.6 TWebResponsiveGrid Background Color

Hi,

In an earlier version I was using:

gObligations.Items.Items[J-1].ElementHandle.style.setProperty('background-color','green');

to set individual items to a specific color. This no longer works so how should I do this?

Thanks,

Ken

This still works.

Tested this in the responsivegrid demo with code added:

procedure TForm1.WebButton1Click(Sender: TObject);
begin
  WebResponsiveGrid1.Items[0].ElementHandle.style.setProperty('background-color','green');
end;

image

I am adding the items in code and it doesn't work for me.

Further to this. It does not work if the items are added and the background set in a beginupdate/endupdate.

Please provide a sample source project with which we can reproduce this so we know exactly what code is used and what the control property settings are.

Test project attached.
Responsive Grid.zip (14.7 KB)

You cannot access ElementHandle when the item is added within BeginUpdate/EndUpdate.
It is only when EndUpdate is called, that all underlying HTML is created and thus when ElementHandle exists.

Ok, thanks but this used to work fine. I will look through them and set the colors after the endupdate.