Skip to main content
A newer version of this page is available. .

BaseView.Assign(BaseView, Boolean) Method

Copies the settings of a View object to the current one.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v19.1.dll

Declaration

public virtual void Assign(
    BaseView v,
    bool copyEvents
)

Parameters

Name Type Description
v BaseView

A BaseView object or descendant representing the source of the operation.

copyEvents Boolean

true, if event handlers assigned to the source BaseView object should be assigned to the corresponding events of the destination View object; otherwise, false.

Remarks

The Assign method is used to copy the settings of the BaseView object specified by the v parameter to the current View object. This method copies public properties of the source View object and, if the copyEvents parameter is true, the event handlers assigned. This makes it possible to have several View objects with the same behavior and appearance.

Note that the Assign method calls the BaseView.BeginUpdate and BaseView.EndUpdate methods before and after copying settings. Thus, you don’t need to call them manually.

Descendant Views override this method to implement proper assignment.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Assign(BaseView, Boolean) 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.

See Also