This question is locked. New answers and comments are not allowed.
Hi,
When i run this I get no errors and it runs as desired .....
When i run this i get no errors and it runs as desired with ajaxbinding ...
But when i add columns to this I get errors ....
I get this error with line 10 highlighted ? ....
Not sure what I am doing wrong ?
Thanks for your time
When i run this I get no errors and it runs as desired .....
| <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<BCAnalytics.Models.Company>>" %> |
| <% Html.Telerik() |
| .Grid(Model) |
| .Name("Companies") |
| .PrefixUrlParameters(false) |
| .Columns(columns => |
| { |
| columns.Add(c => |
| { |
| %> |
| <%= Html.ActionLink("Edit", "Edit", new { id = c.coCompanyNo })%> |
| <%= Html.ActionLink("Delete", "Delete", new { id = c.coCompanyNo })%> |
| <% |
| }).Title("Action"); |
| columns.Add(c => c.coMemberNo).Width(20); |
| columns.Add(c => c.coCompanyNo); |
| columns.Add(c => c.coCompanyName); |
| columns.Add(c => c.coContact); |
| columns.Add(c => c.coEmail); |
| columns.Add(c => c.coGroupCode); |
| }) |
| .Filterable() |
| .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn)) |
| .Pageable() |
| .Scrollable(scrolling => scrolling.Height(200)) |
| .Render(); %> |
| <p><%= Html.ActionLink("Create New", "Create") %></p> |
When i run this i get no errors and it runs as desired with ajaxbinding ...
| <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<BCAnalytics.Models.CompanyVM>>" %> |
| <%= Html.Telerik().Grid(Model) |
| .Name("CompanyGrid") |
| .Columns(columns => |
| { |
| columns.Add(o => o.cMemberNo).Width(20); |
| columns.Add(o => o.cCompanyNo).Width(20); |
| columns.Add(o => o.cCompanyName).Width(50); |
| columns.Add(o => o.cEmail).Width(50); |
| columns.Add(o => o.cGroupCode).Width(50); |
| columns.Add(o => o.cDateCreated).Format("{0:MM/dd/yyyy}").Width(50); |
| }) |
| .Ajax(settings => settings.Action("_AjaxBindingCompany", "Company")) |
| .Pageable() |
| .Sortable() |
| .Scrollable() |
| .Filterable() %> |
| <p><%= Html.ActionLink("Create New", "CompanyCreate") %></p> |
But when i add columns to this I get errors ....
| <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<BCAnalytics.Models.CompanyVM>>" %> |
| <%= Html.Telerik().Grid(Model) |
| .Name("CompanyGrid") |
| .Columns(columns => |
| { |
| columns.Add(c => |
| { |
| %> |
| <%= Html.ActionLink("Edit", "CompanyEdit", new { id = c.cCompanyNo })%> |
| <%= Html.ActionLink("Delete", "CompanyDelete", new { id = c.cCompanyNo })%> |
| <% |
| }).Title("Action"); |
| columns.Add(o => o.cMemberNo).Width(20); |
| columns.Add(o => o.cCompanyNo).Width(20); |
| columns.Add(o => o.cCompanyName).Width(50); |
| columns.Add(o => o.cEmail).Width(50); |
| columns.Add(o => o.cGroupCode).Width(50); |
| columns.Add(o => o.cDateCreated).Format("{0:MM/dd/yyyy}").Width(50); |
| }) |
| .Ajax(settings => settings.Action("_AjaxBindingCompany", "Company")) |
| .Pageable() |
| .Sortable() |
| .Scrollable() |
| .Filterable(); %> |
| <p><%= Html.ActionLink("Create New", "CompanyCreate") %></p> |
I get this error with line 10 highlighted ? ....
| Server Error in '/' Application. |
| -------------------------------------------------------------------------------- |
| Compilation Error |
| Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. |
| Compiler Error Message: CS1525: Invalid expression term ')' |
| Source Error: |
| Line 6: { |
| Line 7: columns.Add(c => |
| Line 8: { |
| Line 9: |
| Line 10: %> |
Thanks for your time