Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
column.Bound(x => x.ReportUrl).ClientTemplate("<a href='#= ReportUrl #' target='_blank'>#= ReportUrl #</a>").Width(100);Can I use a ClientTemplate to invoke a method from my controller when I click on the record in grid?
Maybe there is some examples?
Hello Deivydas,
To access a server-side method when a specified Grid table cell is clicked, you need to trigger an AJAX request to the respective method. For example:
column.Bound(x => x.ReportUrl) .ClientTemplate("<a href='javascript:;' onclick='report(\"#= ReportUrl #\");'>#= ReportUrl #</a>"); <script> function report(reportUrl) { $.ajax({ url: reportUrl, type: "POST", success: function() { ... } }); } </script>
Let me know if this approach works for you.
Regards, Mihaela Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.