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

Custom command

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
HtmlHelper
TagHelper
Files:
custom_command.cshtml
Custom_CommandController.cs
EmployeeViewModel.cs
Custom_Command_TagHelper.cshtml

Also available for:

CLIENT-SIDE API SERVER-SIDE API

Description

The demonstrated solution in this example shows how to implement a custom command column in the ASP.NET Core Grid by Telerik.

To do it you need to include a command column in the grid which will render a button in the column cells that triggers the command. Through the column definition you can specify the text for the button and wire its click event to a JavaScript function:

columns.Command(command => command.Custom("ViewDetails").Click("showDetails"));
The generated button will be decorated with a class which follows the convention "k-grid-[CommandName]" and the click handler receives the corresponding grid as an argument.

In this demo we use a Kendo UI Window widget to display details about the chosen row in the ASP.NET Core grid.

More about Telerik Grid for ASP.NET Core

Support & Learning Resources