HtmlContentControl.CustomEditor Event
Allows you to assign custom in-place editors (Repository Items) to individual <input>
tags. The event is not in effect for <input>
tags used to embed external controls.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v24.2.dll
Declaration
Event Data
The CustomEditor event's data class is DevExpress.XtraEditors.CustomEditorEventArgs.
Remarks
You can use the <input>
HTML tag as a placeholder for external controls and in-place editors (Repository Items) that you want to display within a layout.
The following example defines two <input>
tags. The first tag explicitly specifies a repositoryItemTextEdit1 object as the default in-place editor. The second tag implicitly specifies a date editor as the default in-place editor (based on the data type of the bound field):
<!-- Explicit text in-place editor (repositoryItemTextEdit1). -->
<input class="editor" value="${StringData}" name="repositoryItemTextEdit1"/>
<!-- Implicit in-place editor (date editor) selected based on the data type of the bound field. -->
<input class="editor" value="${OrderDate}"/>
The CustomEditor
event allows you to assign in-place editors to <input>
tags dynamically, and thus override the default editors explicitly or implicitly assigned to the tags.
RepositoryItemButtonEdit riButtonEdit;
riButtonEdit = new RepositoryItemButtonEdit();
htmlContentControl1.RepositoryItems.Add(riButtonEdit);
// Customize the button editor.
// ...
private void htmlContentControl1_CustomEditor(object sender, CustomEditorEventArgs e) {
if (e.FieldName == "Password")
e.RepositoryItem = riButtonEdit;
}
The e.FieldName
event parameter identifies the currently processed input tag. It specifies the tag’s bound field name (the value
argument of the <input>
tag).
Use the e.RepositoryItem
event parameter to specify an in-place editor for the current input tag. The in-place editor must be added to the HtmlContentControl.RepositoryItems collection or an external repository (see EditorContainer.ExternalRepository).
Use Separate In-place Editors to Display and Edit Values
The custom editor you specify in the CustomEditor event is used both when the editor is not active (browse mode), and active (edit mode). Handle the HtmlContentControl.CustomEditorForEditing event to specify an in-place editor only for edit mode.
Related API
Properties
Events
- HtmlContentControl.ShowingEditor
- HtmlContentControl.ShownEditor
- HtmlContentControl.ValidatingEditor
- HtmlContentControl.HiddenEditor
- HtmlContentControl.EditorValueChanged
- HtmlContentControl.EditorValueChanging
HtmlContentControl.CustomEditor
- HtmlContentControl.CustomEditorForEditing
Methods
- HtmlContentControl.ShowEditor
- HtmlContentControl.CloseEditor
- HtmlContentControl.HideEditor
- HtmlContentControl.PostEditor
- HtmlContentControl.SetFieldValue
- HtmlContentControl.GetFieldValue