Hi, I am using Telerik grid in Razor pages applications. I have main grid and Detail grid.
<script id="orderItemsTemplate" type="text/kendo-tmpl">@(
Html.Kendo().Grid<OrderItemInfo>()
.Name("OrderItemsGrid_#=RowId#") // Unique grid name using rowid
.Columns(columns =>
{
columns.Bound(o => o.ItemDescription).Title("Item Description").Width("20%");
columns.Bound(o => o.QtyDelivered).Title("Qty Delivered").Width(50).Hidden();
columns.Bound(o => o.OrderNo).Title("Order No").Width(90);
})
.ToolBar(tb => tb.Columns())
.AllowCopy(true)
.Selectable(s => s.Enabled(true))
.Sortable()
.Events(events =>
{
events.DataBound("onOrderItemsGridDataBound");
})
.Size(ComponentSize.Small)
.Resizable(resize => resize.Columns(true))
.DataSource(dataSource => dataSource.Custom()
.ServerGrouping(false)
.ServerPaging(false)
.ServerFiltering(false)
.ServerAggregates(false)
.ServerSorting(false)
)
.ToClientTemplate()
)
</script>
Problem: .ToolBar(tb => tb.Columns()) is not working on Detail grid template.