Tab
A newer version of this page is available. Switch to the current version.

ButtonEditPropertiesBase.Buttons Property

Gets the collection of editor buttons.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public EditButtonCollection Buttons { get; }
Public ReadOnly Property Buttons As EditButtonCollection

Property Value

Type Description
EditButtonCollection

An EditButtonCollection object representing the collection of buttons displayed within the editor.

Remarks

Use the Buttons property to access the collection of editor buttons.

Note that the ClearButton instance can't be used within the Buttons collection. Instead, use the ASPxButtonEditBase.ClearButton property to adjust the clear button's configuration.


<dx:ASPxButtonEdit ID="btnTest" runat="server" ClearButton-DisplayMode="Always">
    <ClearButton Position="Right" DisplayMode="Always"></ClearButton>
NOTE

The Buttons property synchronizes its value with the editor's ASPxButtonEditBase.Buttons property.

Examples

This example demonstrates how to customize the collection of an editor's edit buttons and how to change the DropDownButton position.

The default drop-down button's position can be changed via the EditButton.Position property. Using this property, you can display the button at the left or at the right control side. To display the drop-down button at the custom position (between other edit buttons), hide the default button using the EditButton.Visible property. After that, you can create a custom drop-down button in the required place.

NOTE

To work properly, a control should have only one drop-down button: a default one or custom one (with a hidden default drop-down button).

The code sample below demonstrates how to create a custom EditButtonCollection within the ASPxDateEdit control. The image below shows the result.

ASPxDateEdit_Buttons

function onButtonClick (s, e) {
     var date = dateedit.GetDate();
     switch (e.buttonIndex) {
          case 0:
               var today = new Date();
               dateedit.SetDate(today);
               break;
          case 1:
               date.setDate(date.getDate() - 1);
               dateedit.SetDate(date);
               break;
          case 2: 
               date.setDate(date.getDate() + 1);
               dateedit.SetDate(date);
               break;
          case 4:
               dateedit.SetValue(null);
     };
}
See Also