ButtonEditSettings Class

Contains the ButtonEdit extension settings.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v19.2.dll

Declaration

public class ButtonEditSettings :
    EditorSettings
Public Class ButtonEditSettings
    Inherits EditorSettings

Remarks

To declare the ButtonEdit in a View, invoke the ExtensionsFactory.ButtonEdit helper method. This method returns the ButtonEdit extension that is implemented by the ButtonEditExtension class.

To configure the ButtonEdit extension, pass the ButtonEditSettings object to the ExtensionsFactory.ButtonEdit helper method as a parameter. The ButtonEditSettings object contains all the ButtonEdit extension settings.

To access the ButtonEdit specific settings, refer to the ButtonEditSettings.Properties property.

Refer to the ButtonEdit Overview topic to learn how to add the ButtonEdit extension to your project.

View code (Razor):

<script type="text/javascript">
    function buttonEdit1_ButtonClick(s, e) {
        switch (e.buttonIndex) {
            case 0:
                s.SetText("");
                break;
            case 1:
                s.SetText("Some text");
                break;
        }
    }
</script>

@Html.DevExpress().ButtonEdit(
    settings => {
        settings.Name = "buttonEdit1";

        settings.Text = "Some text";
        settings.Width = 200;
        settings.Properties.Buttons.Add("Clear");
        settings.Properties.Buttons.Add("Fill");
        settings.Properties.ClientSideEvents.ButtonClick = "buttonEdit1_ButtonClick";
    }).GetHtml()

The code result is demonstrated in the image below.

buttonedit-declaration.png

Inheritance

See Also