Back to Devexpress

RepositoryItem.Assign(RepositoryItem) Method

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitem-dot-assign-x28-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitem-x29.md

latest3.1 KB
Original Source

RepositoryItem.Assign(RepositoryItem) Method

Copies settings from the repository item specified as a parameter.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public virtual void Assign(
    RepositoryItem item
)
vb
Public Overridable Sub Assign(
    item As RepositoryItem
)

Parameters

NameTypeDescription
itemRepositoryItem

A RepositoryItem object whose settings are to be copied to the current object.

|

Remarks

The Assign method is useful if you need to create editors with similar settings. You can customize a single editor, copy its settings to others and then customize the properties whose values should differ.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Assign(RepositoryItem) 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-display-editors-in-columns-headers/CS/WindowsApplication1/InplaceEditorHelper/ColumnInplaceEditorHelper.cs#L124

csharp
ActiveEditor.Parent = view.GridControl;
ActiveEditor.Properties.Assign(_Item);
ActiveEditor.Properties.AutoHeight = false;

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

vb
ActiveEditor.Parent = view.GridControl
ActiveEditor.Properties.Assign(_Item)
ActiveEditor.Properties.AutoHeight = False

See Also

RepositoryItem Class

RepositoryItem Members

DevExpress.XtraEditors.Repository Namespace