Getting Started with ASP.NET Core GroupButton

30 Apr 20211 minute to read

GroupButton initialization

This section explains you briefly on how to create a GroupButton in your application with ASP.NET Core. You can easily create the Button control by using Tag helper as follows.

  1. You can create a .NetCore Project with the help of the given ASP.NET Core-Getting Started documentation.
  2. Add the following code example to the corresponding view page to render GroupButton.
/*ej-Tag Helper code to render GroupButton*/

<ej-group-button id="GroupButton" width="100%" group-button-mode="@GroupButtonMode.RadioButton" show-rounded-corner="true">
    <e-group-button-items>
        <e-group-button-item text="Day"></e-group-button-item>
        <e-group-button-item text="Week"></e-group-button-item>
        <e-group-button-item text="Month"></e-group-button-item>
    </e-group-button-items>
</ej-group-button>
  • CSHTML
  • /*Razor code to render GroupButton*/
    
        @{Html.EJ().GroupButton("GroupButton").GroupButtonMode(GroupButtonMode.RadioButton).ShowRoundedCorner(true).Items(item =>
        {
            item.Add().Text("Day");
            item.Add().Text("Week");
            item.Add().Text("Month");
        }).Render();
        }

    NOTE

    To render the GroupButton Control you can use either Razor or Tag helper code as given in the above code snippet.

    Also we can use the dataSource, to create the GroupButton which is explained under the dataSource section in this documentation.