This project is read-only.

How to render multiple Links in a single column

May 22, 2014 at 8:03 AM
Hi. I want two links "Details" and "Delete" to a single column called "Action". Can anyone let me know how to render it inside Grid.MVC
May 22, 2014 at 8:29 PM
Edited May 22, 2014 at 8:29 PM

You can use @helper in Razor to achieve this. Here is how I did to display two buttons in one column:
@helper RenderActionColumn(int versionId) { 
    <input type="button" value="Open" onclick="showDocID(versionId);" class="btn btn-info"><br />
    <input type="button" value="Details" onclick="openDocumentDetail(versionId);" class="btn btn-info" data-toggle="modal" data-target="#documentDetailModal"><br />

And the column in Grid:
 columns.Add().Titled("Action").Encoded(false).Sanitized(false).RenderValueAs(c => RenderActionColumn(c.VersionId));
Marked as answer by Bukharin on 5/31/2014 at 7:54 AM