Skip to main content

EditorButtonCollection.AddRange(EditorButton[]) Method

Adds an array of buttons to the current button collection.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual void AddRange(
    EditorButton[] buttons
)

Parameters

Name Type Description
buttons EditorButton[]

An array of EditorButton objects to add to the current button collection.

Remarks

Use the AddRange method to add several buttons to the current button collection. The buttons parameter specifies an array of EditorButton objects to be added.

If you need to add a single button to the collection, use the EditorButtonCollection.Add method instead.

The following code adds two predefined buttons (OK and Delete) for a buttonEdit1 control. To remove old buttons, the Clear method is called.

EditorButton [] buttons = {new EditorButton(ButtonPredefines.OK), 
      new EditorButton(ButtonPredefines.Delete)};
  buttonEdit1.Properties.Buttons.Clear();
  buttonEdit1.Properties.Buttons.AddRange(buttons);

The result of the code is shown below:

ButtonEdit_AddRange

See Also