GridView.Assign(BaseView, Boolean) Method

Copies property values and, optionally, event handlers from the View specified as a parameter.

Namespace: DevExpress.XtraGrid.Views.Grid

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 descendant representing the View whose settings should be copied to the current View.

copyEvents Boolean

true to copy event handlers; otherwise, false.

Remarks

Note that the target View is reset before copying. This means that the target View's column collection, group summary collection and other properties are cleared before synchronizing the Views' settings.

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