Template Support in EJ 1 ASP.NET MVC Toolbar
10 May 2017 / 1 minute to read
Template allows you to insert custom or ASP.NET MVC controls inside the toolbar items. Also you can design simple drop down buttons listing the items and radio button inside the Toolbar.
Set the list for DropDown control inside a list element and define this element as a Toolbar item. You can use all simple controls as a ToolBar item. For example to add RadioButton and DropDownList to Toolbar, use the following code example.
/ / Add this code in your CSHTML page and refer local data section for data source
@Html.EJ().Toolbar("toolbar").Items(s =>
{
s.Add().ContentTemplate(@<div>
@Html.EJ().RadioButton("radio1").Checked(false)
</div>);
s.Add().ContentTemplate(@<div>
@Html.EJ().DropDownList("select").Height("23").Width("100").TargetID("cars").SelectedItemIndex(0)
<div id="cars">
<ul>
<li>Audi A4</li>
<li>Audi A5</li>
<li>Audi A6</li>
<li>Audi A7</li>
</ul>
</div>
</div>);
})
The following screenshot displays a Toolbar with embedded controls.
Toolbar with Template
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page