TDBSynEdit
| Component | Description |
|---|---|
![]() | TDBSynEdit 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
| Property | Description |
|---|---|
DataSource | The TDataSource the editor is connected to. |
DataField | The name of the (memo) field edited. |
Field | The TField object, read only. |
OnLoadData | Event 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;
