unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, NxGridView6, Data.DB, NxColumns6, NxDBColumns6, Datasnap.DBClient, NxControls6,
  NxCustomGrid6, NxVirtualGrid6, NxDBGrid6, Vcl.ExtCtrls, Vcl.DBCtrls, Vcl.Menus, Vcl.StdCtrls, Vcl.Mask, Vcl.Grids,
  Vcl.DBGrids;

type
  TForm1 = class(TForm)
    NextDBGrid61: TNextDBGrid6;
    DataSource1: TDataSource;
    NxReportGridView61: TNxReportGridView6;
    DBNavigator1: TDBNavigator;
    PopupMenu1: TPopupMenu;
    ExpandContent1: TMenuItem;
    DBEdit1: TDBEdit;
    DBMemo1: TDBMemo;
    Label1: TLabel;
    Label2: TLabel;
    Button1: TButton;
    ClientDataSet1: TClientDataSet;
    ClientDataSet1Person: TStringField;
    ClientDataSet1Note: TMemoField;
    ClientDataSet1Button: TStringField;
    NxDBTextColumn61: TNxDBTextColumn6;
    NxDBMemoColumn61: TNxDBMemoColumn6;
    Button2: TButton;
    NxDBTextColumn62: TNxDBButtonColumn6;
    procedure NxDBMemoColumn61HeaderButtonClick(Sender: TObject; X, Y: Integer; var Accept: Boolean);
    procedure ExpandContent1Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses
  NxTypes6, NxGraphics6;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  ClientDataSet1.Append;
  ClientDataSet1.Fields.FieldByName('Button').AsString := 'Sample';
  ClientDataSet1.Fields.FieldByName('Person').AsString := 'George';
  ClientDataSet1.Fields.FieldByName('Note').AsString := 'With ExpandContent set to True, Memo column can show full content of TMemoField.';
  ClientDataSet1.Post;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  NextDBGrid61.BestFitRow(NextDBGrid61.SelectedRow);
end;

procedure TForm1.ExpandContent1Click(Sender: TObject);
begin
  NxDBMemoColumn61.ExpandContent := ExpandContent1.Checked;
  NxDBMemoColumn61.VerticalAlignment := taAlignTop;
end;

procedure TForm1.NxDBMemoColumn61HeaderButtonClick(Sender: TObject; X, Y: Integer; var Accept: Boolean);
begin
  Accept := False;
  PopupMenu1.Popup(X, Y);
end;

end.
