I'm getting the following error:
System.Web.HttpCompileExceptionc:\inetpub\sites\...\Areas\Admin\Views\Administrator\ListWorkflows.cshtml(34):
error CS1660: Cannot convert lambda expression to type 'string' because
it is not a delegate type.
If I removed line 34 marked **** below it works but when it is not comment out it throws the error.
@(Html.Telerik().Grid<... .Areas.Admin.ViewModels.Administrator.ListWorkflowViewModel>()
.Name("Grid")
.DataKeys(keys => {
keys.Add(m => m.Id);
})
.Columns(columns => {
columns.Bound(m => m.ConsolidationId).Title("Consolidation Id");
columns.Bound(m => m.CurrentStatus).Title("Status");
columns.Bound(m => m.CurrentStatusDate).Title("Status Date");
**** columns.Bound(m => m.CurrentStatusedByEmail).Title("Statused By Email");
columns.Bound(m => m.CreatedDate).Title("Created Date");
columns.Bound(m => m.Email)
.ClientTemplate("<a href='" + Url.Action("Impersonate", "Impersonate") + "?email=<#= Email #>'><#= Email #></a>")
.Title("Patient Email");
columns.Bound(m => m.Id)
.ClientTemplate("<a href='#' workflowId='<#= Id #>' class='changeStatus'>Change Status</a>")
.Title("Change Status");
})
.Pageable(paging =>
paging.PageSize(50)
.Style(GridPagerStyles.NextPreviousAndNumeric)
.Position(GridPagerPosition.Bottom)
.PageTo(1)
)
.Selectable()
.Sortable(sorting => sorting.Enabled(true))
.Filterable()
.DataBinding(dataBinding => {
dataBinding.Ajax().Select("_SelectWorkflows", "Administrator", new { name = Model.Name});
})
.ClientEvents(events => events
.OnDataBound("onDataBound")
)
)
The view model it is being bound to looks like this:
public class WorkflowListItem {
public string ConsolidationId { get; set; }
public DateTime CreatedDate { get; set; }
public string CurrentStatus { get; set; }
public DateTime CurrentStatusDate { get; set; }
public string CurrentStatusedByEmail { get; set; }
public string Email { get; set; }
public string Id { get; set; }
public string SiteName { get; set; }
public string Type { get; set; }
}
I see no difference that should be causing this error??
Any help is appreciated!!
Found the solution. I hadn't added CurrentStatusedByEmail to the paging ViewModel.