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

Custom command

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
  • Edit in Theme Builder
  • custom_command.cshtml
  • Custom_CommandController.cs
  • EmployeeViewModel.cs

Also available for:

API REFERENCE

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