Skip to content

TDBSynEdit ​

ComponentDescription
TDBSynEditTDBSynEdit is the data-aware version of TSynEdit: it edits a memo field of a dataset, like a TDBMemo, with all the features of the editor (highlighting, folding, search...).

Unit: SynEdit.DBEdit. Inheritance: TCustomSynEdit > TCustomDBSynEdit > TDBSynEdit. Platforms: Win32 and Win64.

pascal
uses
  SynEdit.DBEdit;

Data properties ​

PropertyDescription
DataSourceThe TDataSource the editor is connected to.
DataFieldThe name of the (memo) field edited.
FieldThe TField object, read only.
OnLoadDataEvent fired when the data is loaded from the field into the editor.

The editor loads the content of the field when the record changes (a Unicode memo field is read as UTF-16, the others with the default encoding) and puts the dataset in edit mode when the text is changed.

Other properties ​

TDBSynEdit publishes the same appearance and behavior properties of TSynEdit that are needed for a data editor: Highlighter, Options, Gutter, BookMarkOptions, Keystrokes, SearchEngine, RightEdge, TabWidth, ReadOnly, ScrollBars and the main events (OnChange, OnGutterClick, OnSpecialLineColors, OnProcessCommand...). See TSynEdit.

Example ​

pascal
SynEditDB.DataSource := DataSourceScripts;
SynEditDB.DataField := 'SCRIPT_TEXT';
SynEditDB.Highlighter := SynSQLSyn1;

Released under the MPL 1.1 / GPL 2 dual license.