1

I have the following web grid.

selectionFieldName: "selectedRow", ajaxUpdateContainerId: "gridContent");
grid.Pager(WebGridPagerModes.NextPrevious);}
<div id="gridContent">
@grid.GetHtml(tableStyle: "webGrid",
        headerStyle: "header",
        alternatingRowStyle: "alt",
        selectedRowStyle: "select",
        columns: grid.Columns(
        grid.Column("TaskID", "TaskID"),
        grid.Column("TaskDesc", " Task Desc", format:  @Html.Raw(task.TaskDesc)),
        grid.Column("TaskTitle", "Task Title", style: "description")

 ))

This line :

    grid.Column("TaskDesc", " Task Desc", format:  @Html.Raw(task.TaskDesc)),

gives me an error. Is there a way I can use @html.Raw helper within the webgird without it throwing an error ?

2
  • 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: CS1502: The best overloaded method match for 'System.Web.Helpers.WebGrid.Column(string, string, System.Func<dynamic,object>, string, bool)' has some invalid arguments Commented Nov 18, 2014 at 16:05
  • Can you output the description outside of the grid? Commented Nov 19, 2014 at 6:32

1 Answer 1

0

You should be able to do this:

grid.Column("TaskDesc", " Task Desc", format:  (item) => Html.Raw(item.TaskDesc)),
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.