TcxCustomEditorRowProperties.EditPropertiesClassName Property
Specifies the in-place editor type by its class name.
Declaration
property EditPropertiesClassName: string read; write;
Property Value
Type | Description |
---|---|
string | The name of the active in-place editor properties class. Warning An assigned name should match the name of any existing terminal TcxCustomEditProperties class descendant; otherwise, runtime errors may occur. We recommend that you use the EditPropertiesClass or RepositoryItem property to specify the required in-place editor type in code. |
Remarks
A vertical grid row can use any editor shipped with the ExpressEditors Library as an in-place editor for cell edit operations. An in-place editor instance exists (and, therefore, has its own WinAPI handle) only when a data cell is being edited. Otherwise, the vertical grid row displays a static editor image for resource usage optimization.
Warning
The EditPropertiesClassName
property is designed to store the name of the required editor settings class in a DFM file. If a name assigned to the EditPropertiesClassName
property in code does not match an existing terminal TcxCustomEditProperties class descendant, runtime errors may occur.
Since a RAD Studio® compiler cannot verify that a correct class name is assigned to the PropertiesClassName
property, we recommend that you use the EditPropertiesClass property or assign a configured repository item component to the RepositoryItem property to define the required in-place editor for the data item.
Editor Selection at Design Time
At design time, you can use the Object Inspector to select any available in-place editor. Click a vertical grid row’s Properties.EditProperties node and select the required editor from the invoked drop-down list.
Property Setter Behavior
The EditPropertiesClassName
property setter updates EditProperties and EditPropertiesClass property values according to the selected in-place editor type.
Code Example: Create an Unbound Row and Configure Its In-Place Editor
The following code example creates an unbound vertical grid row, assigns an in-place spin editor, and customizes its settings:
// ...
uses
cxSpinEdit;
// ...
var
AEditorRow: TcxEditorRow;
ASpinEditProperties: TcxSpinEditProperties;
begin
AEditorRow := TcxEditorRow(cxVerticalGrid1.Add(TcxEditorRow)); // Creates an unbound vertical grid row
AEditorRow.Properties.DataBinding.ValueType := 'Float'; // Changes the row value type to "Float"
AEditorRow.EditPropertiesClassName := "TcxSpinEditProperties"; // Assigns an in-place spin editor
ASpinEditProperties := AEditorRow.Properties.EditProperties as TcxSpinEditProperties;
ASpinEditProperties.MinValue := 0; // Sets the minimum edit value
ASpinEditProperties.MaxValue := 100; // Sets the maximum edit value
ASpinEditProperties.DisplayFormat := '0.00 %'; // Defines a formatting pattern for display text
ASpinEditProperties.Circular := True; // Loops value changes within the defined range
end;
Important Limitations
- If an editor has unbound and data-aware versions, you can use only its unbound version as an in-place editor.
- If the RepositoryItem property is specified, EditProperties,
EditPropertiesClassName
, and EditPropertiesClass property values are ignored.
Important
Do not change EditPropertiesClass, EditPropertiesClassName
, and EditProperties property values in OnGetEditProperties and OnGetEditingProperties event handlers. Otherwise, drawing error and access violations may occur.
To change the active editor and modify its settings safely within these event handlers, use the RepositoryItem property and TcxEditRepositoryItem class descendants. Refer to OnGetEditProperties and OnGetEditingProperties event descriptions for detailed information and code examples.
Default In-Place Editors
A vertical grid row uses the default in-place editor if EditProperties, EditPropertiesClass, EditPropertiesClassName
, and RepositoryItem properties are unspecified. The vertical grid row uses one of the following in-place editors as default depending on DataBinding.ValueType and DataBinding.ValueTypeClass property values:
ValueType[1] Value | ValueTypeClass[1] Value | Default Editor |
---|---|---|
Boolean |
TcxBooleanValueType | TcxCheckBox |
Currency |
TcxCurrencyValueType | TcxCurrencyEdit |
DateTime |
TcxDateTimeValueType | TcxDateEdit |
FMTBcd |
TcxFMTBcdValueType | TcxCurrencyEdit |
SQLTimeStamp |
TcxSQLTimeStampValueType | TcxDateEdit |
Any other value | Any other value | TcxTextEdit |
-
DataBinding.ValueType and DataBinding.ValueTypeClass property values define the default in-place editor for the vertical grid row regardless of the active data access mode.