I have a grid defined thusly:
@Model VendorManagement.Web.Models.RiskExposureViewModel
@using Kendo.Mvc.UI
@(Html.Kendo().Grid(Model.RiskMatrixExposureList)
.Name("grdRiskMatrix")
.Columns(columns =>
{
columns.Bound(c => c.RiskUnit).Title("Risk Unit");
columns.Bound(c => c.RiskCategory).Title("Risk Category");
columns.Bound(c => c.RiskDescription).Title("Short Description");
})
.Read(read => read.Action("BindRiskMatrixGrid", "Risk"))
.Pageable()
)
RiskMatrixExposureList is a List<RiskMatrixExposure>. The grid as defined is throwing the following error in Razor:
"Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type"
I have the namespace defined in Views/web.config:
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization"/>
<add namespace="System.Web.Routing" />
<add namespace="VendorManagement.Web" />
<add namespace="Kendo.Mvc.UI" />
</namespaces>
</pages>
</system.web.webPages.razor>
Thanks for they help!