GridToolBarCustomCommandBuilder
Methods
Name(System.String)
Sets the command name.
Parameters
name - System.String
The name of the command
Example
@(Html.Kendo().Grid<User>()
.Name("grid")
.ToolBar(toolbar =>
{
toolbar.Custom().Name("CustomCommand");
})
)
ClientTemplateView(Microsoft.AspNetCore.Html.IHtmlContent)
Sets the toolbar command template handler.
Parameters
value - Microsoft.AspNetCore.Html.IHtmlContent
The partial view that will be rendered for the toolbar command template.
Example
@(Html.Kendo().Grid<User>()
.Name("grid")
.ToolBar(toolbar =>
{
toolbar.Custom().Name("CustomCommand").ClientTemplateView(Html.Partial("_CustomCommand"));
})
)
ClientTemplateHandler(System.String)
Sets the toolbar command template handler.
Parameters
handler - System.String
Example
@(Html.Kendo().Grid<User>()
.Name("grid")
.ToolBar(toolbar =>
{
toolbar.Custom().Name("CustomCommand").ClientTemplateHandler("myHandler");
})
)
ClientTemplate(Kendo.Mvc.UI.TemplateBuilder)
Sets the toolbar command template.
Parameters
template - TemplateBuilder<TModel>
The template component that will be set for the command template.
Example
@(Html.Kendo().Grid<User>()
.Name("grid")
.ToolBar(toolbar =>
{
toolbar.Custom().Name("CustomCommand").ClientTemplate(Html.Kendo()
.Template()
.AddHtml("Some Template")
);
})
)
ClientTemplate(System.String)
Sets the toolbar command template.
Parameters
template - System.String
The action defining the template.
Example
@(Html.Kendo().Grid<User>()
.Name("grid")
.ToolBar(toolbar =>
{
toolbar.Custom().Name("CustomCommand").ClientTemplate("Custom Command");
})
)
ClientTemplateId(System.String)
Sets the id of the script element which contains the client-side toolbar command template.
Parameters
template - System.String
The ID of script that will be rendered for the toolbar command template.
Example
@(Html.Kendo().Grid<User>()
.Name("grid")
.ToolBar(toolbar =>
{
toolbar.Custom().Name("CustomCommand").ClientTemplateId("customCommandTemplate");
})
)
Text(System.String)
Sets the text displayed in the button.
Parameters
text - System.String
The text which should be displayed
IconClass(System.String)
The class for the web font icon of the button.
Parameters
iconClass - System.String
The class for the web font icon of the button
HtmlAttributes(System.Object)
Sets the HTML attributes.
Parameters
attributes - System.Object
The HTML attributes.
HtmlAttributes(System.Collections.Generic.IDictionary)
Sets the HTML attributes.
Parameters
attributes - System.Collections.Generic.IDictionary<String,Object>
The HTML attributes.