How to change htmlText to all fields in data grid

87 views Asked by At

How to change htmlText to all fields in group "DGP"? I am using this code:

repeat with x = 1 to 16--the number of lines in dataarray
      put the htmlText of field x  of group "DGP"  into myHtml
      replace ss with "<font bgcolor=" & quote & "green" & quote & ">" & ss & "</font>" in myHtml 
      set the htmlText  of field x of  group "DGP" to myHtml
   end repeat

If I write the number of lines in dataarray instead of 16, the following error occurs:

group "NDGP": execution error at line 35 (Chunk: no such object), char 11

I think this is because of the small size of the grid. When I changed the code to 16 it works, but if I scroll down, the bgcolor is lost.

1

There are 1 answers

0
Mark On

If you changed the htmlText propeties of the fields of a datagrid, you would ignore the datagrid-specific properties. The datagrid might even completely ignore the changes and display the original data as soon as an update of the visible part of the data is triggered, e.g. by scrolling.

You should not change the htmlText property of individual fields of a datagrid.