I need to use the Html.ActionLink in the format: property of the grid.Column specification. My code goes as below:
grid.GetHtml(
grid.Columns(
grid.Column(header: "Column 1", format: (item) => @<div class='webgrid-bookname-column-style'> @item.BookName </div>),
grid.Column(header: "Column 2", format: (item) => Html.ActionLink(item.StartTime, "ShowShippingFileMessage", new { @id = item.BookName }))
)
)
When I use this syntax, it gives me the compilation error of
The best overloaded method match for System.Web.Helpers.WebGrid.Column(string, string, System.Func<dynamic,object>, string, bool) has some invalid arguments
When I change the item.StartTime above with a normal text like "Edit" then it works fine.
I am new to ASP.NET, can anyone please help me understand what is wrong with the above statements?
Thanks in advance.