Overview
TheTGridEditing class manages how cells are edited in a TeeGrid. It provides comprehensive control over when and how editing begins, what editor controls are used, and how user input is processed.
Class Hierarchy
Key Features
- Auto-edit mode for immediate editing
- Double-click or single-click activation
- Always-visible editors
- Custom editor class support per column
- Configurable Enter key behavior
- Text selection options
Properties
Active
False
Note: This property is typically set internally by the grid. Read this property to check if editing is in progress.
Example:
AlwaysVisible
True, the editor control remains visible for the selected cell at all times.
Default: False
Example:
AutoEdit
True, typing in a selected cell immediately starts editing mode without requiring a double-click or F2 key.
Default: False
Example:
DoubleClick
True, double-clicking a cell starts edit mode. When False, a single click is sufficient.
Default: True
Example:
EnterKey
TEditingEnter
Values:
TEditingEnter.NextCell- Move to the next cell in the current rowTEditingEnter.NextRow- Move to the same column in the next rowTEditingEnter.SameCell- Stay in the current cell
TEditingEnter.NextCell
Example:
EditorClass
TEdit (or platform equivalent)
Example:
Text
Methods
Constructor Create
TGridEditing instance.
Parameters:
AChanged: Event handler called when editing properties change
Assign
Source: The source object to copy from
ClassOf
EditorClass.
Parameters:
AColumn: The column to get the editor class for
TClass of the editor control
Example:
TTextEditing Class
TheTTextEditing class configures text-specific editing behavior.
Properties
Selected
True, all text in the editor is selected when editing begins.
Default: True
TEditingEnter Enumeration
Defines the behavior when the Enter key is pressed during editing.- NextCell - Move to the next editable cell in the current row
- NextRow - Move to the same column in the next row
- SameCell - Stay in the current cell (multi-line editing)
Usage Examples
Basic Editing Configuration
Always-Visible Editor
Excel-Like Navigation
Custom Editor for Specific Column
Disable Editing for Entire Grid
Disable Editing for Specific Column
Checking Edit State
Starting Edit Programmatically
Multi-Line Text Editing
Conditional Editing
Editor Workflow
The typical workflow for cell editing:- Activation - User double-clicks (or single-clicks) a cell, or types when
AutoEditis enabled - Editor Display - Grid creates and displays the appropriate editor control
- Editing - User modifies the cell content
- Commit - User presses Enter or Tab, or clicks another cell
- Validation - Grid validates and saves the new value
- Navigation - Based on
EnterKeysetting, focus moves to next cell
Important Notes
Editing only works on columns that have
ReadOnly set to False. The grid-level ReadOnly property overrides all column settings.See Also
- TGridSelection - Cell selection management
- TGridBands - Grid bands for headers and footers
- TIndicator - Grid row indicator column
