just in case someone is interested in a solution for my initial question, I ended up being able to implement it, and here's how I did it:
01.
@(Html.Kendo().Grid<SearchResultModel>()
02.
.Name(
"Results"
)
03.
.Pageable()
04.
.Sortable()
05.
.Selectable()
06.
.Resizable(resize => resize.Columns(
true
))
07.
.Events(e => e.DataBound(
"onSearchResultsDataBound"
).Change(
"onSearchResultsChange"
))
08.
.Columns(async columns =>
09.
{
10.
columns.Bound(r => r.A).Title().Width(100);
11.
columns.Bound(r => r.B).Title().Width(100);
12.
columns.Bound(r => r.C).Title().Width(100);
13.
columns.Bound(r => r.D).Title().Width(220);
14.
columns.Command(c => c.Custom(
"CustomButton"
).TemplateId(
"commandsTemplate"
)).Width(70);
15.
})
16.
.DataSource(dataSource => dataSource
17.
.Ajax()
18.
.PageSize(Constants.DefaultPageSize)
19.
.Sort(o => o.Add(m => m.Organization))
20.
.Read(read => read.Action(nameof(BlablaController.Query), BlablaController.ControllerName,
new
21.
{
22.
culture = Localizer.CultureName
23.
}).Data(
"onResultsGridAdditionalData"
))
24.
))
25.
26.
27.
<script id=
"commandsTemplate"
type=
"text/x-kendo-template"
>
28.
<div
class
=
'dropdown'
>
29.
<button
class
=
'btn'
type=
'button'
id=
'dropdownMenuButton'
data-toggle=
'dropdown'
aria-haspopup=
'true'
aria-expanded=
'false'
><i
class
=
'fas fa-ellipsis-h'
></i> </button>
30.
<div
class
=
'dropdown-menu dropdown-menu-right'
aria-labelledby=
'dropdownMenuButton'
>
31.
<a href=
""
role=
"editButton"
class
=
"dropdown-item"
>Edit</a>
32.
</div>
33.
</div>
34.
</script>
35.
36.
37.
<script>
38.
function onSearchResultsChange() {
39.
var selection =
this
.select();
40.
var closestTr = $(
"tr[data-uid='"
+ selection.data().uid +
"']"
);
41.
var editLink = closestTr.children().last().find(
"a[role='editButton']"
)[0];
42.
editLink.href = buildLink(
this
.dataItem(selection));
43.
}
44.
</script>
I guess if my grid was not selectable, it would have been more complicated, but this solution works pretty well for my use case.
The buildLink javascript function can then do whatever you want based on your data item.