Back to Devexpress

RepositoryItem.CreateEditor() Method

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitem-3bee5669.md

latest5.2 KB
Original Source

RepositoryItem.CreateEditor() Method

Creates an editor whose type corresponds to the repository item’s type.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public virtual BaseEdit CreateEditor()
vb
Public Overridable Function CreateEditor As BaseEdit

Returns

TypeDescription
BaseEdit

A BaseEdit descendant representing the editor whose type corresponds to this repository item’s type.

|

Remarks

Container controls use this method to create editors when end-users start to edit cell values. The method only creates an appropriate editor type and container controls synchronize its settings with the repository item’s values.

You will have no need to use this method in your applications.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateEditor() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-grid-enable-editing-in-group-row-to-change-cell-values/CS/WindowsApplication3/GroupEditProvider.cs#L140

csharp
if (editors.ContainsKey(editorType)) return editors[editorType];
BaseEdit groupEdit = column.RealColumnEdit.CreateEditor();
groupEdit.Parent = view.GridControl;

xaf-how-to-show-a-hyper-link-url-email-etc-for-a-business-class-property/CS/HyperLinkPropertyEditor.Win/GridListEditorOpenHyperLinkViewController.cs#L32

csharp
if(repositoryItemHyperLinkEdit != null) {
    HyperLinkEdit editor = (HyperLinkEdit)repositoryItemHyperLinkEdit.CreateEditor();
    editor.ShowBrowser(WinHyperLinkStringPropertyEditor.GetResolvedUrl(gv.GetRowCellValue(hi.RowHandle, hi.Column)));

winforms-grid-display-editors-in-columns-headers/CS/WindowsApplication1/InplaceEditorHelper/ColumnInplaceEditorHelper.cs#L121

csharp
{
    ActiveEditor = _Item.CreateEditor();
    ActiveEditor.Properties.LockEvents();

winforms-grid-enable-editing-in-group-row-to-change-cell-values/VB/WindowsApplication3/GroupEditProvider.vb#L135

vb
End If
Dim groupEdit As BaseEdit = column.RealColumnEdit.CreateEditor()
groupEdit.Parent = view.GridControl

xaf-how-to-show-a-hyper-link-url-email-etc-for-a-business-class-property/VB/HyperLinkPropertyEditor.Win/GridListEditorOpenHyperLinkViewController.vb#L34

vb
If repositoryItemHyperLinkEdit IsNot Nothing Then
    Dim editor As HyperLinkEdit = CType(repositoryItemHyperLinkEdit.CreateEditor(), HyperLinkEdit)
    editor.ShowBrowser(WinHyperLinkStringPropertyEditor.GetResolvedUrl(gv.GetRowCellValue(hi.RowHandle, hi.Column)))

winforms-grid-display-editors-in-columns-headers/VB/InplaceEditorHelper/ColumnInplaceEditorHelper.vb#L114

vb
Private Sub ShowEditor(ByVal bounds As Rectangle)
    ActiveEditor = _Item.CreateEditor()
    ActiveEditor.Properties.LockEvents()

See Also

RepositoryItem Class

RepositoryItem Members

DevExpress.XtraEditors.Repository Namespace