Problem rendering Telerik MVC Grid in a Razor view

别来无恙 提交于 2019-12-04 12:57:54

This is because of different approach to rendering Razor's views. In order to make it work you have to remove Render() call and build grid in multiline expression block, like this:

@using Telerik.Web.Mvc.UI
@model Outdoor.Mvc.ViewModels.OutdoorSite.SiteList
@(
    Html.Telerik().Grid(Model.ItemList).Name("Site Grid")
        .Columns(columns => 
        {
            columns.Bound(o => o.SiteId);         
            columns.Bound(o => o.Name);
        })
        .Pageable()
        .Sortable()
)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!