Created
March 26, 2013 13:31
-
-
Save terra819/5245367 to your computer and use it in GitHub Desktop.
Webgrid sample syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
var grid = new WebGrid(Model, canSort: true, canPage: false, defaultSort: "Column1Value"); | |
} | |
@grid.GetHtml( | |
columns: grid.Columns( | |
grid.Column("Column1Value", "Column 1 Heading", canSort: true), | |
grid.Column("Column2Value", "Column 2 Heading", canSort: true), | |
grid.Column("Actions", | |
format: @<text> | |
@Html.ActionLink("Action Link 1 Text", "ActionLink1Command") | | |
@Html.ActionLink("Action Link 2 Text", "ActionLink2Command") | |
</text> | |
) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment