Behavior Settings in EJ 1 ASP.NET MVC GroupButton

26 Apr 2018 / 1 minute to read

Groupbutton provides options through which you can customize the default behavior of Groupbutton control.

Groupbutton Mode

The default behavior of Groupbutton is like Radiobutton, i.e., only one item can be selected at a time.

  • html
  • @Html.EJ().GroupButton("GroupButton").GroupButtonMode(GroupButtonMode.RadioButton).Items(item =>
                       {
                           item.Add().Text("Save");
                           item.Add().Text("Open");
                           item.Add().Text("Delete");
                       })

    Radiobutton
    RadioButton mode {:.caption}

    To enable selection of one or more Groupbutton items at a time, you can set the Groupbutton mode to Checkbox. With this, you can toggle the each button’s state to perform actions, since all the button will behave like individual buttons.

  • html
  • @Html.EJ().GroupButton("GroupButton").GroupButtonMode(GroupButtonMode.CheckBox).Items(item =>
                       {
                           item.Add().Text("Save");
                           item.Add().Text("Open");
                           item.Add().Text("Delete");
                       })

    Checkbox
    CheckBox mode {:.caption}