All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Hello.
I'm doing this example: https://demos.telerik.com/aspnet-core/grid/custom-command
I would like to add a button to the view, the button should redirect to a controller action with a parameter. attached image
How could I do it?
Hi Alveiro,
Attached to my reply, you will find a runnable example of how the targeted functionality in the popup Window can be implemented.
Here are the modifications applied in the Window's template. In the below code, the yellow line defines the additional button added to the popup.
<script type="text/x-kendo-template" id="template"> <div id="details-container"> <h4>#= OrderID # #= OrderDate #</h4> <em>#= Freight #</em> <dl> <dt>City: #= ShipCity #</dt> <dt>Name: #= ShipName #</dt> </dl> <a class="k-button" href="/Grid/LoadPage?customParam=#= ShipCity #">Go To controller and load View</a> </div> </script>
When the button is clicked, it will send the "customParam" to the LaodPage controller that is defined as follows:
public ActionResult LoadPage(string customParam) { return View("LoadView", new LoadViewModel { CustomParam = customParam }); }
The above controller will load the LoadView partial view.
I hope the provided example will help you implement the targeted functionality in the application you are working on.
Regards, Petar Progress Telerik