GridCustomActionCommandBuilder
Methods
Click(System.Func)
Sets the click handler for the custom action command using a delegate function.
Parameters
handler - System.Func<Object,Object>
The delegate function that will be executed when the command is clicked.
Click(System.String)
Sets the name of the JavaScript function that will be executed when the custom action command is clicked.
Parameters
handler - System.String
The name of the JavaScript function to execute on click.
Action(System.String,System.String,System.Web.Routing.RouteValueDictionary)
Sets the controller action that will be executed when the custom action command is invoked.
Parameters
actionName - System.String
The name of the action method.
controllerName - System.String
The name of the controller.
routeValues - System.Web.Routing.RouteValueDictionary
Additional route values to include in the action URL.
Action(System.String,System.String,System.Object)
Sets the controller action that will be executed when the custom action command is invoked.
Parameters
actionName - System.String
The name of the action method.
controllerName - System.String
The name of the controller.
routeValues - System.Object
An anonymous object containing additional route values to include in the action URL.
Action(System.String,System.String)
Sets the controller action that will be executed when the custom action command is invoked.
Parameters
actionName - System.String
The name of the action method.
controllerName - System.String
The name of the controller.
SendDataKeys(System.Boolean)
Sets whether the data keys of the current row should be sent when the custom action command is executed.
Parameters
value - System.Boolean
If true, data keys will be sent; otherwise, they will not be included.
SendState(System.Boolean)
Sets whether the current state of the grid (sorting, filtering, paging) should be sent when the custom action command is executed.
Parameters
value - System.Boolean
If true, grid state will be sent; otherwise, it will not be included.
DataRouteValues(System.Action)
Configures the data route values that will be sent with the custom action command.
Parameters
factory - System.Action<GridDataKeyFactory>
The factory method that configures which data keys from the current row will be included as route values.
Template(System.String)
The template of the command column.
Parameters
value - System.String
The value that configures the template.
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Command(cmd=>cmd.Custom("Button").Template("Button Template"));
}))
Template(Kendo.Mvc.UI.Fluent.TemplateBuilder)
Sets the template of the command column.
Parameters
template - TemplateBuilder<T>
The template component
Example
@Html.TextBox("value")
</text>
)
);
})
)
TemplateId(System.String)
The template of the command column.
Parameters
value - System.String
The value that configures the template.
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Command(cmd=>cmd.Custom("Button").TemplateId("TemplateId"));
}))
TemplateView(System.Web.Mvc.MvcHtmlString)
The template of the command column.
Parameters
value - System.Web.Mvc.MvcHtmlString
The value that configures the template.
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Command(cmd=>cmd.Custom("Button").TemplateView(Html.Partial("CommandTemplate")));
}))
TemplateHandler(System.String)
The name of the JavaScript function that returns the template of the command column.
Parameters
value - System.String
Text(System.String)
Sets the text displayed by the command. If not set a default value is used.
Parameters
text - System.String
The text which should be displayed
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Command(cmd=>cmd.Custom("Button").Text("Text"));
}))
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
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Command(cmd=>cmd.Custom("Button").IconClass("k-icon k-i-check"));
}))
HtmlAttributes(System.Object)
Sets the HTML attributes.
Parameters
attributes - System.Object
The HTML attributes.
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Command(cmd=>cmd.Custom("Button").HtmlAttributes(new { @class="myClass" }));
}))
HtmlAttributes(System.Collections.Generic.IDictionary)
Sets the HTML attributes.
Parameters
attributes - System.Collections.Generic.IDictionary<String,Object>
The HTML attributes.
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Command(cmd=>cmd.Custom("Button").HtmlAttributes(new Dictionary<string, object>() { }));
}))
HtmlAttributes(System.String)
Sets the HTML attributes.
Parameters
attributesHandler - System.String
The HTML attributes.
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Command(cmd=>cmd.Custom("Button").HtmlAttributes("attributesHandler"));
}))
Visible(System.Func)
Sets the visible function which will determine if the command button will render.
Parameters
handler - System.Func<Object,Object>
The visible function.
Visible(System.String)
Sets the visible function which will determine if the command button will render.
Parameters
handler - System.String
The visible function.
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Command(cmd=>cmd.Custom("Button").Visible("handlerName"));
}))