Saturday 17 August 2013

Webgrid: Cannot convert lambda expression to type 'object' because it is not a delegate type

Webgrid: Cannot convert lambda expression to type 'object' because it is
not a delegate type

Im trying to add in the webgrid column an html image with this code:
@model List<LoUCore.Models.Artifact>
@{
var grid = new WebGrid(Model);
List<WebGridColumn> column = new List<WebGridColumn>();
column.Add(new WebGridColumn { ColumnName = "Filepath", Header =
"Sprite",Format = (x => @<text><img src="@x.Filepath"></img></text>)
});
}
@grid.GetHtml(columns: grid.Columns(column.ToArray()))
But im getting the following error: CS1660: Cannot convert lambda
expression to type 'object' because it is not a delegate type
Any ideas?

No comments:

Post a Comment