What I'm actually after is your example in the ListBox. The box on the Right side has UP/DOWN arrows.
https://demos.telerik.com/aspnet-core/listbox/events
Hmmm, maybe I'll get away from the Grid on this one. How do I select an item in the listbox similar to the grid so I can navigate to the Details View (MVC)?
My current grid definition:
@(Html.Kendo().Grid<
SessionOptionTemplate
>()
.Name("grid")
.Columns(columns =>
{
columns.Command(command => command
.Custom("Details")
.Click("goDetail"))
.Width(Glossary.Portal.ButtonWidth);
columns.Bound(p => p.Name);
columns.Bound(p => p.IsActive);
columns.Bound(p => p.Order);
})
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.HtmlAttributes(new { style = "height:550px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("IndexJson", "SessionOptionTemplates").Data("gridGetData"))
.Model(m => m.Id(p => p.Id))
))
Script:
<
script
type
=
"text/javascript"
>
var customerId = $("#customerId").val();
var customerUniqueId = $("#customerUniqueId").val();
function gridGetData() {
//alert("grid.gridGetData");
//alert("customerId: " + customerId);
return {
customerId: customerId,
customerUniqueId: customerUniqueId
};
}
function goDetail(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var url = '@Url.Action("Details", "SessionOptionTemplates")?id=' + dataItem.Id + '@Model.GetUrlParameters()';
// Replace & with & as the above encoding step changes & to &.
window.location.href = url.replace(/&/g, "&");
}
...