Skip to main content

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.v24.2.dll

Declaration

public override void Assign(
    BaseView v,
    bool copyEvents
)

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

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