How To in EJ 1 ASP.NET MVC Toolbar
9 Apr 2018 / 1 minute to read
Render Toolbar from code behind
Toolbar can be rendered from the code behind by initializing the required properties in controller and passing those properties via ViewData or Model to the client side
The following code illustrates the rendering of Toolbar using Toolbar properties from code behind.
@{
Html.EJ().Toolbar("toolbar", (Syncfusion.JavaScript.Models.ToolbarProperties)ViewData["toolbar"]).Render();
}
public ActionResult Index()
{
List<ToolbarBaseItem> obj = new List<ToolbarBaseItem>();
obj.Add(new ToolbarBaseItem() { SpriteCssClass= "e-icon e-cut" ,TooltipText="cut"});
obj.Add(new ToolbarBaseItem() { SpriteCssClass = "e-icon e-copy", TooltipText = "copy" });
obj.Add(new ToolbarBaseItem() { SpriteCssClass = "e-icon e-paste", TooltipText = "paste" });
ToolbarProperties toolbar = new ToolbarProperties();
toolbar.Items = obj;
ViewData["toolbar"] = toolbar;
return View();
}
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