ColumnView.Assign(BaseView, Boolean) Method

Copies properties and, optionally, event handlers from another View to the current one.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v20.1.dll

Declaration

public override void Assign(
    BaseView v,
    bool copyEvents
)
Public Overrides Sub Assign(
    v As BaseView,
    copyEvents As Boolean
)

Parameters

Name Type Description
v BaseView

A BaseView object representing a View whose properties and event handlers are to be copied.

copyEvents Boolean

true if event handlers should be copied; otherwise, false.

Remarks

The method supports the grid control's internal infrastructure and is not intended to be called from your code.

If the specified View is a ColumnView object or descendant, the Assign method copies columns and their settings (properties and event handlers). Before copying columns, all columns in the current View are deleted.

NOTE

If you copy settings to a grid control's View before this grid's data source is initialized, certain column settings (e.g., GridColumn.UnboundExpression of unbound columns) do not automatically take effect. You can use one of following solutions to resolve the issue:

  • Set the target grid's data source after the Assign method is called.
  • Call the target View's View.DataController.RePopulateColumns method after the Assign method is called.

More details can be found in this support ticket.

See Also