A single developer license allows 1 developer to use the components for development, obtain free updates & support for a full version cycle of the product. The license is not transferable.
A single developer license allows 1 developer to use the components for development, obtain free updates & support for 1 year. The license is not transferable.
A single developer license allows 1 developer to use the components for development, obtain free updates & support for 2 years. The license is not transferable.
A small team license allows 2 developers within the company to use the components for development, obtain free updates & support for a full version cycle of the product. The license is not transferable.
A small team license allows 2 developers within the company to use the components for development, obtain free updates & support for 1 year. The license is not transferable.
A small team license allows 2 developers within the company to use the components for development, obtain free updates & support for 2 years. The license is not transferable.
A site license allows an unlimited number of developers within the company to use the components for development, obtain free updates & support for a full version cycle of the product. Developers can be added at any time during the full version cycle.
A site license allows an unlimited number of developers within the company to use the components for development, obtain free updates & support for 1 year. Developers can be added at any time during the 1 year period.
A site license allows an unlimited number of developers within the company to use the components for development, obtain free updates & support for 2 years. Developers can be added at any time during the 2 year period.
TAdvStringGrid
Example 2 : Dynamic cell colors
Often, there is a need to draw the attention to special values calculated and
presented in a grid. In this example, attention is drawn to some cells by changing
the cell background and text color depending on the values in the cell. The
grid is filled with random values between -500 and +500. Foreground and background
color of positive and negative numbers can be specified with 2 TColorGrid components.
Setting colors is done in the OnGetCellColor event handler :
procedure TForm1.AdvStringGrid1GetCellColor(Sender: TObject;
ARow,
ACol: Integer; AState: TGridDrawState; ABrush: TBrush; AFont:
TFont);
begin
if advstringgrid1.cells[acol,arow]<>'' then
if advstringgrid1.ints[acol,arow]<0 then
begin
abrush.color:=colorgrid2.backgroundcolor;
afont.color:=colorgrid2.foregroundcolor;
end
else
begin
abrush.color:=colorgrid1.backgroundcolor;
afont.color:=colorgrid1.foregroundcolor;
afont.style:=[fsBold]
end;
end;
First a test is done to check if the cell contains data, then this data is accessed
as an integer data type with the Ints property of TAdvStringGrid. The background
color is specified in "abrush" and font color in "afont.color". The test could
be much more elaborated, as well as the font itself could be changed depending
on the cell value. Finally, one more event handler is used to let the grid repaint
when other colors are selected in the ColorGrid components. Therefore, the OnChange
event handler is for both ColorGrid1 and ColorGrid2 :
procedure TForm1.ColorGrid1Change(Sender: TObject);
begin
advstringgrid1.Repaint;
end;