Have almost got Mike's solution with the manipulation of tgrid to work. The only thing I'd like to know is how to set the background in ApplyStyling procedure?
Procedure TFinanicalCell.ApplyStyling;
begin
FontColor:= claBlue;
Font.Size:= 18;
// Background ?
if Assigned(Font.OnChanged) then
Font.OnChange(Font);
Repaint;
end;
I also wonder why the value is 0 in my setData procedure?
Procedure TFinancialCell.SetData(const Value: TValue);
var
F: Single;
begin
F := Value.Astype<single>;
inherited SetData(Format('%m',[F]));
end;
My GetValue procedure:
procedure TForm5.Grid1GetValue(Sender: TObject; const Col, Row: Integer; var Value: TValue);
begin
if Col = 0 then
Value := Row
else if Col = 1 then
begin
Value := FloatToStr(Data[Row]);
if Data[Row] >30 then
begin
Value := '#' + FloatToStr(Data[Row]);
end;
end;
end;