New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent interface for configuring toolbar custom command.

Definition

Constructors

Initializes a new instance of the GridToolBarCustomCommandBuilder class.

C#
public GridToolBarCustomCommandBuilder(GridToolBarCustomCommand command)
Parameters:commandGridToolBarCustomCommand

The GridToolBarCustomCommand instance.

Methods

Sets the toolbar command template.

C#
public void ClientTemplate(string template)
Parameters:templatestring

The action defining the template.

Example:
C#
@(Html.Kendo().Grid<User>()
.Name("grid")
.ToolBar(toolbar =>
{
toolbar.Custom().Name("CustomCommand").ClientTemplate("Custom Command");
})
)

Sets the toolbar command template.

C#
public GridToolBarCustomCommandBuilder ClientTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

The template component that will be set for the command template.

Returns:

GridToolBarCustomCommandBuilder

Returns the current GridToolBarCustomCommandBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Grid&lt;User&gt;()
.Name("grid")
.ToolBar(toolbar =&gt;
{
toolbar.Custom().Name("CustomCommand").ClientTemplate(Html.Kendo()
.Template()
.AddHtml("Some Template")
);
})
)

Sets the toolbar command template handler.

C#
public GridToolBarCustomCommandBuilder ClientTemplateHandler(string handler)
Parameters:handlerstringReturns:

GridToolBarCustomCommandBuilder

Returns the current GridToolBarCustomCommandBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Grid&lt;User&gt;()
.Name("grid")
.ToolBar(toolbar =&gt;
{
toolbar.Custom().Name("CustomCommand").ClientTemplateHandler("myHandler");
})
)

Sets the id of the script element which contains the client-side toolbar command template.

C#
public void ClientTemplateId(string template)
Parameters:templatestring

The ID of script that will be rendered for the toolbar command template.

Example:
C#
@(Html.Kendo().Grid&lt;User&gt;()
.Name("grid")
.ToolBar(toolbar =&gt;
{
toolbar.Custom().Name("CustomCommand").ClientTemplateId("customCommandTemplate");
})
)

Sets the toolbar command template handler.

C#
public GridToolBarCustomCommandBuilder ClientTemplateView(IHtmlContent value)
Parameters:valueIHtmlContent

The partial view that will be rendered for the toolbar command template.

Returns:

GridToolBarCustomCommandBuilder

Returns the current GridToolBarCustomCommandBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Grid&lt;User&gt;()
.Name("grid")
.ToolBar(toolbar =&gt;
{
toolbar.Custom().Name("CustomCommand").ClientTemplateView(Html.Partial("_CustomCommand"));
})
)

Sets the command name.

C#
public GridToolBarCustomCommandBuilder Name(string name)
Parameters:namestring

The name of the command

Returns:

GridToolBarCustomCommandBuilder

Returns the current GridToolBarCustomCommandBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Grid&lt;User&gt;()
.Name("grid")
.ToolBar(toolbar =&gt;
{
toolbar.Custom().Name("CustomCommand");
})
)