unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, NxColumns6, NxGridView6, NxControls6, NxCustomGrid6,
  NxVirtualGrid6, NxGrid6, NxTypes6;

type
  TForm1 = class(TForm)
    NextGrid61: TNextGrid6;
    NxReportGridView61: TNxReportGridView6;
    NxTextColumn61: TNxTextColumn6;
    Sallary: TNxNumberColumn6;
    NxCheckBoxColumn61: TNxCheckBoxColumn6;
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure NxReportGridView61GetCellColor(Sender: TObject; ACol,
      ARow: Integer; var CellColor: TColor; State: TNxCellPaintingState);
    procedure NxReportGridView61GetCellGrid(Sender: TObject; ACol,
      ARow: Integer; var Edges: TNxBorderEdges;
      State: TNxCellPaintingState);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  NextGrid61.AddCells([
    'John', '28900.23',
    'Lucy', '25561.44',
    'George', '32012.35',
    'Ben', '21466.00',
    'Donna', '26316.00',
    'Lance', '24090.00'
  ], [
    NxTextColumn61.Index,
    Sallary.Index
  ]);
end;

procedure TForm1.NxReportGridView61GetCellColor(Sender: TObject; ACol,
  ARow: Integer; var CellColor: TColor; State: TNxCellPaintingState);
begin
  if not(csSelected in State)
    and (ARow < NextGrid61.RowCount) then
  begin
    if ACol = Sallary.Index then
      if NextGrid61.CellBy['Sallary', ARow].AsFloat < 25000 then
      begin
        CellColor := $000066ff;
      end;
  end;
end;

procedure TForm1.NxReportGridView61GetCellGrid(Sender: TObject; ACol,
  ARow: Integer; var Edges: TNxBorderEdges; State: TNxCellPaintingState);
begin
  if ARow < NextGrid61.RowCount then
  begin
    if ACol = NxTextColumn61.Index then
      if NextGrid61.CellBy['Sallary', ARow].AsFloat > 30000 then
      begin
        Edges[beLeft].Color := clGreen;
        Edges[beTop].Color := clGreen;
        Edges[beRight].Color := clGreen;
        Edges[beBottom].Color := clGreen;
      end;
  end;

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  with NextGrid61.Columns.Add(TNxProgressColumn6) do
  begin
    Editing := True;
  end;
end;

end.
