How do I add a custom column to the MvcContrib grid?

I haven't found a way to add a custom column to the MvcContrib grid. With the old version, you can:

column.For("Edit").Do(p => { %>
        <td>
            <a href="/People/Edit/<%= p.Id %>">Edit</a>
        </td>
    %>});

      

But with the latest version the Do () method disappears ... So now which method is using?

+2


source to share


1 answer


I find a solution:

You have to use namespace MvcContrib.UI.Grid.ActionSyntax

and it provides you with an extension method called Action.



Here's a simple usage:

column.For("PDF").Named("PDF").Action(p => { %> 
<td><img src="../Content/Images/pdf.gif" /></td> <% });

      

+1


source







All Articles