Back to Devexpress

ButtonEditSettings Class

aspnetmvc-devexpress-dot-web-dot-mvc-9407669d.md

latest3.0 KB
Original Source

ButtonEditSettings Class

Contains the ButtonEdit extension settings.

Namespace : DevExpress.Web.Mvc

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

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public class ButtonEditSettings :
    EditorSettings
vb
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.

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.

Inheritance

Object SettingsBase EditorSettings ButtonEditSettings

See Also

ButtonEditSettings Members

ButtonEdit

ButtonEditExtension

DevExpress.Web.Mvc Namespace