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

Defines the fluent interface for configuring command.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

TCommand

The type of the command.

TBuilder

The type of the builder.

Syntax:

C#
public abstract class GridActionCommandBuilderBase<TCommand, TBuilder> where TCommand : GridActionCommandBase where TBuilder : GridActionCommandBuilderBase<TCommand, TBuilder>

Inheritance: objectGridActionCommandBuilderBase<TCommand, TBuilder>

Derived Classes: GridCustomActionCommandBuilder<T>GridDestroyActionCommandBuilderGridEditActionCommandBuilderGridSelectActionCommandBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the GridActionCommandBuilderBase<TCommand, TBuilder> class.

C#
public GridActionCommandBuilderBase(TCommand command)
Parameters:commandTCommand

The command.

Properties

Command

TCommand

C#
protected TCommand Command { get; }

Methods

Sets the HTML attributes.

C#
public TBuilder HtmlAttributes(IDictionary<string, object> attributes)
Parameters:attributesIDictionary<string, object>

The HTML attributes.

Returns:

TBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =&gt;
{
columns.Command(cmd=&gt;cmd.Custom("Button").HtmlAttributes(new Dictionary&lt;string, object&gt;() {  }));
}))

Sets the HTML attributes.

C#
public TBuilder HtmlAttributes(object attributes)
Parameters:attributesobject

The HTML attributes.

Returns:

TBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =&gt;
{
columns.Command(cmd=&gt;cmd.Custom("Button").HtmlAttributes(new { @class="myClass" }));
}))

Sets the HTML attributes.

C#
public TBuilder HtmlAttributes(string attributesHandler)
Parameters:attributesHandlerstring

The HTML attributes.

Returns:

TBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =&gt;
{
columns.Command(cmd=&gt;cmd.Custom("Button").HtmlAttributes("attributesHandler"));
}))

The class for the web font icon of the button.

C#
public TBuilder IconClass(string iconClass)
Parameters:iconClassstring

The class for the web font icon of the button

Returns:

TBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =&gt;
{
columns.Command(cmd=&gt;cmd.Custom("Button").IconClass("k-icon k-i-check"));
}))

The template of the command column.

C#
public TBuilder Template(string value)
Parameters:valuestring

The value that configures the template.

Returns:

TBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =&gt;
{
columns.Command(cmd=&gt;cmd.Custom("Button").Template("Button Template"));
}))

Sets the template of the command column.

C#
public TBuilder Template<T>(TemplateBuilder<T> template)
Parameters:templateTemplateBuilder<T>

The template component

Returns:

TBuilder

Example:
C#
@(Html.Kendo().Grid&lt;User&gt;()
.Name("grid")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Name).Template(Html.Kendo().Template()
.AddHtml(
@&lt;text&gt;
Value
@Html.TextBox("value")
&lt;/text&gt;
)
);
})
)

The name of the JavaScript function that returns the template of the command column.

C#
public TBuilder TemplateHandler(string value)
Parameters:valuestringReturns:

TBuilder

The template of the command column.

C#
public TBuilder TemplateId(string value)
Parameters:valuestring

The value that configures the template.

Returns:

TBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =&gt;
{
columns.Command(cmd=&gt;cmd.Custom("Button").TemplateId("TemplateId"));
}))

The template of the command column.

C#
public TBuilder TemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the template.

Returns:

TBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =&gt;
{
columns.Command(cmd=&gt;cmd.Custom("Button").TemplateView(Html.Partial("CommandTemplate")));
}))

Sets the text displayed by the command. If not set a default value is used.

C#
public TBuilder Text(string text)
Parameters:textstring

The text which should be displayed

Returns:

TBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =&gt;
{
columns.Command(cmd=&gt;cmd.Custom("Button").Text("Text"));
}))

Sets the visible function which will determine if the command button will render.

C#
public TBuilder Visible(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The visible function.

Returns:

TBuilder

Sets the visible function which will determine if the command button will render.

C#
public TBuilder Visible(string handler)
Parameters:handlerstring

The visible function.

Returns:

TBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =&gt;
{
columns.Command(cmd=&gt;cmd.Custom("Button").Visible("handlerName"));
}))