This question is locked. New answers and comments are not allowed.
Hi Telerik
I'm currently upgrading my MVC project from Visual Studio 2008 to 2010 and from MVC 1 to MVC 2. I'm using VB.NET and was using the 2010.1.309 MVC 2 release which i have upgraded to 2010.1.329 MVC 2 release. In both these telerik builds i get the following error message when the MVC grid trys to render on the page:
I have read the telerik forum post that discusses the issue but i am unable to apply the work around to the VB example below. Could some one please give me an example of how to get the below MVC grid rendering code to work in VB and MVC 2?
Many thanks
Nick
I'm currently upgrading my MVC project from Visual Studio 2008 to 2010 and from MVC 1 to MVC 2. I'm using VB.NET and was using the 2010.1.309 MVC 2 release which i have upgraded to 2010.1.329 MVC 2 release. In both these telerik builds i get the following error message when the MVC grid trys to render on the page:
Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
Line 56: Dim colContractId As New Telerik.Web.Mvc.UI.GridBoundColumn(Of Attenda.CMDBExtensions.Contracts.ContractsSummaryViewModel, String)(grid, Function(c) c.ID)
I have read the telerik forum post that discusses the issue but i am unable to apply the work around to the VB example below. Could some one please give me an example of how to get the below MVC grid rendering code to work in VB and MVC 2?
Many thanks
Nick
<% Dim grid As Telerik.Web.Mvc.UI.Grid(Of Attenda.CMDBExtensions.Contracts.ContractsSummaryViewModel) = Html.Telerik.Grid(Of Attenda.CMDBExtensions.Contracts.ContractsSummaryViewModel) _ .Name("ContractGrid") _ .Sortable() _ .Pageable(Function(p) p.Total(CInt(ViewData("Total")))) _ .Filterable() _ .Selectable() _ .EnableCustomBinding(True) _ .ClientEvents(Function(events) events.OnRowSelected("onRowSelected")) _ .DataBinding(Function(d) d.Ajax().Select("GetContracts", "Contracts")) grid.Paging.PageSize = 20 Dim colContractId As New Telerik.Web.Mvc.UI.GridBoundColumn(Of Attenda.CMDBExtensions.Contracts.ContractsSummaryViewModel, String)(grid, Function(c) c.ID) Dim colContractName As New Telerik.Web.Mvc.UI.GridBoundColumn(Of Attenda.CMDBExtensions.Contracts.ContractsSummaryViewModel, String)(grid, Function(c) c.ContractName) Dim colPORef As New Telerik.Web.Mvc.UI.GridBoundColumn(Of Attenda.CMDBExtensions.Contracts.ContractsSummaryViewModel, String)(grid, Function(c) c.PORef) Dim colClient As New Telerik.Web.Mvc.UI.GridBoundColumn(Of Attenda.CMDBExtensions.Contracts.ContractsSummaryViewModel, String)(grid, Function(c) c.Client) Dim colClients As New Telerik.Web.Mvc.UI.GridBoundColumn(Of Attenda.CMDBExtensions.Contracts.ContractsSummaryViewModel, String)(grid, Function(c) c.Clients) Dim colCurrentStatus As New Telerik.Web.Mvc.UI.GridBoundColumn(Of Attenda.CMDBExtensions.Contracts.ContractsSummaryViewModel, Attenda.CMDBExtensions.Contracts.ContractStatus)(grid, Function(c) c.ContractStatus) Dim colStartDate As New Telerik.Web.Mvc.UI.GridBoundColumn(Of Attenda.CMDBExtensions.Contracts.ContractsSummaryViewModel, String)(grid, Function(c) c.StartDate) Dim colEndDate As New Telerik.Web.Mvc.UI.GridBoundColumn(Of Attenda.CMDBExtensions.Contracts.ContractsSummaryViewModel, String)(grid, Function(c) c.EndDate) colCurrentStatus.Title = "Current Status" colClient.Title = "Contract Owner" colContractId.Sortable = False colContractId.Filterable = False colStartDate.Sortable = True colEndDate.Sortable = True grid.Columns.Add(colContractId) grid.Columns.Add(colContractName) grid.Columns.Add(colPORef) grid.Columns.Add(colClient) grid.Columns.Add(colClients) grid.Columns.Add(colCurrentStatus) grid.Columns.Add(colStartDate) grid.Columns.Add(colEndDate) grid.Render() %>