unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    NextGrid61: TNextGrid6;
    Button1: TButton;
    NxIncrementColumn61: TNxIncrementColumn6;
    NxTextColumn61: TNxTextColumn6;
    NxCheckBoxColumn61: TNxCheckBoxColumn6;
    NxReportGridView61: TNxReportGridView6;
    Button2: TButton;
    Button3: TButton;
    Button5: TButton;
    NxTrackbarColumn61: TNxTrackbarColumn6;
    NxIconColumn61: TNxIconColumn6;
    ImageList1: TImageList;
    NxToolbarColumn61: TNxToolbarColumn6;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure NextGrid61InsertRowQuery(Sender: TObject;
      var Accept: Boolean);
    procedure NextGrid61SelectQuery(Sender: TObject; ACol, ARow: Integer;
      var Accept: Boolean);
    procedure NextGrid61CellClick(Sender: TObject; ACol, ARow: Integer;
      Button: TMouseButton);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  NextGrid61.AddRow();
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  NextGrid61.BestFitCol(NextGrid61.SelectedCol);
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  if NextGrid61.IsSelectionValid then
  begin
    NextGrid61.InsertRow(NextGrid61.SelectedRow, 1);
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
//  NextGrid61.AutoSelect := True;
  NextGrid61.DoubleBuffered := True;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
  if NextGrid61.IsSelectionValid then
  begin
    NextGrid61.DeleteRow(NextGrid61.SelectedRow);
  end;
end;

procedure TForm1.NextGrid61InsertRowQuery(Sender: TObject;
  var Accept: Boolean);
begin
 // Accept := False;
end;

procedure TForm1.NextGrid61SelectQuery(Sender: TObject; ACol,
  ARow: Integer; var Accept: Boolean);
begin
//  if ACol = 1 then Accept := False;
  if ACol = 4 then Accept := False;
end;

procedure TForm1.NextGrid61CellClick(Sender: TObject; ACol, ARow: Integer;
  Button: TMouseButton);
begin
  if ACol = 2 then
  begin
    Caption := NextGrid61.Cells[ACol, ARow];
  end;
end;

end.
