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

EditorButtonCollection.Assign(EditorButtonCollection) Method

Copies buttons from the specified EditorButtonCollection object to the current button collection.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v19.1.dll

Declaration

public virtual void Assign(
    EditorButtonCollection collection
)

Parameters

Name Type Description
collection EditorButtonCollection

The source button collection.

Remarks

You can use the Assign method in order to have different button edit controls with the same buttons. For instance, if you have a button editor with customized buttons and you want to add these to another editor, then you can call Assign rather than adding the buttons one by one via the EditorButtonCollection.Add method.

The Assign method removes all buttons from the current button collection and then creates new buttons by copying button properties from the specified collection.

The following code copies buttons from the buttonEdit1 control to buttonEdit2:


buttonEdit2.Properties.Buttons.Assign(buttonEdit1.Properties.Buttons);
See Also