Skip to content

Instantly share code, notes, and snippets.

@terra819
Created March 26, 2013 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terra819/5245367 to your computer and use it in GitHub Desktop.
Save terra819/5245367 to your computer and use it in GitHub Desktop.
Webgrid sample syntax
@{
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