, TDBGrid, 500 , . ( , VCL, Grids.pas.)
, TDBGrid . , .
- ftMemo, . TDBGrid, (MEMO), , TEdit TRichEdit / .
TDBGrid, TClientDataSet CDS (, ) CDS.FieldDefs Object Inspector:
Column Persistent Name FieldType Size
------ --------------- --------- ----
ID CDSID ftInteger 0
Name CDSName ftString 25
Notes CDSNotes ftMemo 0
, FileName :
procedure TForm1.FormCreate(Sender: TObject);
begin
if not FileExists(CDS.FileName) then
begin
CDS.CreateDataSet;
CDS.Active := True;
CDS.InsertRecord([1, 'John Smith', 'This is some longer text'
CDS.InsertRecord([2, 'Fred Jones', 'A note about Fred goes'
CDS.Active := False;
end;
CDS.Active := True;
end;
a TDataSource DataSource CDS. TDBGrid DataSet DataSource1.
TDBGrid, "" OnCellClick ( , ):
procedure TForm1.DBGrid1CellClick(Column: TColumn);
begin
if Column.FieldName := 'CDSNotes' then
ShowMessage(Column.Field.AsString); // Display other form here instead
end;
CDSNotes 1 TDBGrid:

TDBGrid, - :
procedure TForm2.CDSNotesGetText(Sender: TField; var Text: string;
DisplayText: Boolean);
begin
// Again, a trivial example using an arbitrary chunk of the first 20
// characters just for demo purposes.
if DisplayText then
Text := Copy(Sender.AsString, 1, 20)
else
// Not for display only; return all the text.
Text := Sender.AsString;
end;
:
